#include <math.h>
#include <stdio.h>
int main(){
//字符串的连接 函数
void copy(char s1[],char s2[]);
char s1[100],s2[50];
scanf("%s",s1);
scanf("%s",s2);
copy(s1,s2);
printf("%s\n",s1);
}
void copy(char s1[],char s2[])
{
int i=0,j=0;
while(s1[i]!='\0')
i++;
while(s2[j]!='\0')
s1[i++]=s2[j++];
s1[i]='\0';//记得补!!
}
将一个字符串连接到另一个字符串后面(用函数)输出新的字符串
于 2024-04-19 23:05:34 首次发布