字符串连接

xiaoxiao2021-02-27  187

题目描述

不借用任何字符串库函数实现无冗余地接受两个字符串,然后把它们无冗余的连接起来。

输入描述

每一行包括两个字符串,长度不超过100。

输出描述

可能有多组测试数据,对于每组数据, 不借用任何字符串库函数实现无冗余地接受两个字符串,然后把它们无冗余的连接起来。 输出连接后的字符串。

输入样例

abc def

输出样例

abcdef

提示#include<iostream> #include<cstdio> #include<cmath> #include<vector> #include<algorithm> #include<cstring> using namespace std; char a[105],b[105]; int main() { while(scanf("%s%s",a,b)!=EOF) { vector<string>c; c.push_back(a); c.push_back(b); vector<string>::iterator it; for(it=c.begin();it!=c.end(); ++it) cout<<*it; cout<<endl; } return 0; }

转载请注明原文地址: https://www.6miu.com/read-15555.html

最新回复(0)