Description
编写函数实现字符串连接函数strcat( )的功能。
Input
输入仅一行,输入两个字符串。
Output
输出仅一行,输出连接后的一个字符串。
Sample Input
abc defgh
Sample Output
abcdefgh
Source
#include <stdio.h>
int main()
{
char a[20],b[20];
scanf("%s%s",a,b);
int i,j;
i=0;
while (a[i])
{
i++;
}
j=0;
while (b[j])
{
a[i]=b[j];
i++;
j++;
}
a[i]='\0';
printf("%s",a);
system("pause");
return 0;
}