题解 | #字符串连接#
字符串连接
https://www.nowcoder.com/practice/40d83e5509b04d20825ae68fe35e9ca8
#include<iostream>
#include<string>
using namespace std;
//什么是无冗余的连接起来?
//无冗余连接:即不能用数组占用多余空间
int main(){
char str1[101],str2[101];
while(scanf("%s%s",str1,str2)!=EOF){
string st1=str1,st2=str2;
string st=st1+st2;
printf("%s\n",st.c_str());
}
}
查看10道真题和解析