MyStrCat
字符串链接
http://www.nowcoder.com/questionTerminal/9f27c74ec91e4c7da96ba351dba235fc
#include <stdio.h> #include <string.h> void MyStrCat(char dstStr[],char scrStr[]) { int len1=strlen(dstStr),len2=strlen(scrStr),i; char s[len1+len2]; for(i=0;i<len1;i++) s[i]=dstStr[i]; for(i=0;i<len2;i++) s[len1+i]=scrStr[i]; s[len1+i]='\0'; printf("%s\n",s); } int main() { char s1[100],s2[100]; while(scanf("%s %s",&s1,&s2)!=EOF) MyStrCat(s1,s2); return 0; }