该程序实现了两个字符串的连接功能。通过包含标准库并使用命名空间,定义两个字符串变量a和b,用cin接收用户输入的字符串,最后用cout输出连接后的字符串(a+b)。输入"csdn"时,程序会输出"csdn"。代码简洁高效,展示了C++中字符串的基本操作。
输入
cs dn
输出
csdn
#include<bits/stdc++.h>
using namespace std;
int main(){
string a,b;
cin>>a>>b;
cout<<a+b;
return 0;
}