题解 | #字符串连接#
字符串连接
https://www.nowcoder.com/practice/40d83e5509b04d20825ae68fe35e9ca8
#include <stdio.h>
int main() {
char a[100];char b[100];char c[200];
while(scanf("%s %s",&a,&b)!=EOF){
int i=0;int j=0;
while(1){
if(a[i]!='\0'){i++;
}else{break;}
}
while(1){
if(b[j]!='\0'){j++;
}else{break;}
}
for(int temp=0;temp<i;temp++){
c[temp]=a[temp];
}
for(int temp=i;temp<i+j;temp++){
c[temp]=b[temp-i];
}
c[i+j]='\0';
printf("%s\n",c);
}
return 0;
}
