蓝桥杯算法训练 字符串合并

题目链接

问题描述
  输入两个字符串,将其合并为一个字符串后输出。
输入格式
  输入两个字符串
输出格式
  输出合并后的字符串
样例输入
一个满足题目要求的输入范例。
Hello

World
样例输出
HelloWorld
数据规模和约定
  输入的字符串长度0<n<100

代码:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    
    
	string s1, s2;
	cin >> s1 >> s2;
	cout << s1 + s2; 
	return 0;
}
//字符串拼接,C里面可以用strcat()函数来连接字符数组,C++可以直接用+连接。

猜你喜欢

转载自blog.csdn.net/qq_44826711/article/details/113797423