c-将2个字符勾通在一起

[复制链接]
发表于 2025-12-23 02:27:33 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
#include<stdio.h>
int main()
{
    char s1[80],s2[40];
    int i=0,j=0;
    gets(s1);
    gets(s2);
    while(s1!='\0')
    {
        i++;
    }
    //s1=0;
    while(s2[j]!='\0')
    {
        s1=s2[j];
        i++;
        j++;
    }
    s1='\0';//字符串以0末了 
    printf("The new string is:%s\n",s1);
    return 0;
}
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表