#include<iostream> #include<cstring>using namespace std;int main(){ char s1[]="nihao"; char s2[]="nigansha"; int m=strlen(s1);//strlen()计数不等于\0,此处省略原生代码。 int n=strlen(s2); int length=m+n; char s[length+1]; inti=0; for(i=0;i<m;i++){ s[i]=s1[i]; } for(;i<length;i++){ s[i]=s2[i-m]; } s[length]='\0'; cout<<s<<endl; return 0; }