题解 | #字符串连接#
字符串连接
https://www.nowcoder.com/practice/40d83e5509b04d20825ae68fe35e9ca8
#include<stdio.h>
int main() {
char str1[100];
char str2[100];
while (scanf("%s%s", &str1, str2) != EOF) {
int i = 0, j = 0;
while (str1[i] != '\0')
i++;
while (str2[j] != '\0')
str1[i++] = str2[j++];
str1[i] = '\0';
printf("%s\n", str1);
}
return 0;
}
查看2道真题和解析