U E D R , A S I H C RSS

문자열연결/허아영

소 감

다른아이들도 매우 쉽게 여길 것 같은 문제다.
자료구조에 대한 문제라고 되어있어서 올려봤다.
책이 이제 조금 있으면 스택, 큐 그리고 정렬에 대한 문제들이 많다.
점점 소스 길이가 길어질 것 같다.

소 스

~cpp 
#include <stdio.h>
#include <string.h>

void main(){
	char x[20] = "I love computer"; 
	char y[20] = " You love computer";
	char z[40];
	FILE *fp;
	strcpy(z, x);
	strcat(z, y);
	fp = fopen("result.out", "w");
	fprintf(fp, "x => ");
	fprintf(fp, x);
	fprintf(fp, "\ny => ");
	fprintf(fp, y);
	fprintf(fp, "\nz => ");
	fprintf(fp, z);
}

result.out

~cpp 
x => I love computer
y =>  You love computer
z => I love computer You love computer

나한테 할 말

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:31
Processing time 0.0090 sec