原题: 题目描述 给定两个字符串string1和string2,将字符串string2连接在string1的后面,并将连接后的字符串输出。 输入 输入包含多组数据,每组测试数据包含两行,第一行代表string1,第二行代表string2 输出 对于每组输入数据,对应输出连接后的字符串,每组输出占一行。 示例输入 123 654 abs sfg 示例输出 123654 abssfg 分析: 没什么可分析的,记住下列函数 源码: #include<stdio.h> //没什么难的——water problem~~学习字符串 #include<string.h> #include<iostream> #define N 99999 using namespace std; int main() { char str1[N],str2[N]; while(cin>>str1>>str2) { strcat(str1,str2); //记住这一重要的字符串函数 cout<<str1<<endl; } return 0; } 三醇,加油~~
串结构练习——字符串连接 解题报告
原创bingsanchun ©著作权
©著作权归作者所有:来自51CTO博客作者bingsanchun的原创作品,请联系作者获取转载授权,否则将追究法律责任
下一篇:简单字符串排序解题报告
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
java中字符串连接 java字符串怎么连接
java字符串连接很常见。作为一名Java开发人员,几乎每隔一段时间就会编写用于字符串连接的代码。
java中字符串连接 java连接字符串 字符串连接 字符串 Java