描述
键盘输入两个字符串,将这两个字符串进行拼接后输出。
输入描述:
键盘输入两个字符串
输出描述:
输出两个字符串拼接后的结果
示例1
输入:
hello
nihao
输出:
hellonihao
分析:
使用函数getline(),进行字符串拼接。
代码:
#include <iostream>
#include <string>
using namespace std;
int main() {
string s1, s2;
getline(cin, s1);
getline(cin, s2);
cout << s1 << s2 << endl;
return 0;
}