主函数输入两个字符串,输出连接后的新串。

#include<stdio.h>
int str_copy(char *d,char *s){//将串s连接到d的尾部
    //在这里补充你的代码
}
int main(){
    char pa[81];
    char pb[81];
    char pc[81]=":";
    gets(pa);
    gets(pb); 
    str_copy(pc,pa);
    str_copy(pc,pb);
    printf("%s",pc);
    return 0; 
}

连接的句子需要换行,pc数组只是个媒介,输入两行数据还要原案输出

 

int str_copy(char *d,const char *s){
    //将串s连接到d的尾部
    //在这里补充你的代码
    if(*d!=':')
    {
        while(*d)d++;
    }
    while(*s)
    {
        *d=*s;
        d++;
        s++;
    }
    *d='\n';
}