10/06/24 15:07:11
>>196
演習6-1
#include <stdio.h>
int main(void)
{
char buff[32], str[1024], *p, *q;
int i, n;
printf("何個の文字列を入力しますか?:");
scanf("%d", &n);
for(i = 1, p = str; i <= n; i++) {
printf("入力文字列[%d]:", i);
scanf("%s", buff);
for(q = buff; *q; q++, *p++) *p = *q;
*p++ = ' ';
}
*(p - 1) = '\0';
printf("\n結果:%s\n", str);
return 0;
}