首页 > 试题广场 >

字符串链接

[编程题]字符串链接
  • 热度指数:8383 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 64M,其他语言128M
  • 算法知识视频讲解
不用strcat 函数,自己编写一个字符串链接函数MyStrcat(char dstStr[],charsrcStr[])

输入描述:
两个字符串,字符串由小写字母组成。


输出描述:
链接后的字符串
示例1

输入

hello world
good morning

输出

helloworld
goodmorning
while True:
    try:
        s= input()
        s = list(s)
        for i in range(len(s)):
            if s[i] == ' ':
                break
        del s[i]
        s = ''.join(s)
        print(s)
    except:
        break

发表于 2025-02-26 00:08:35 回复(0)

问题信息

难度:
1条回答 7550浏览

热门推荐

通过挑战的用户

查看代码
字符串链接