网站后台管理系统的主要功能,学校网站建设招聘,网站开发 报价单,东莞网站建设公司排名串结构练习——字符串连接
Description 给定两个字符串string1和string2#xff0c;将字符串string2连接在string1的后面#xff0c;并将连接后的字符串输出。 连接后字符串长度不超过110。 Input 输入包含多组数据#xff0c;每组测试数据包含两行#xff0c;第一行代表s…串结构练习——字符串连接
Description 给定两个字符串string1和string2将字符串string2连接在string1的后面并将连接后的字符串输出。 连接后字符串长度不超过110。 Input 输入包含多组数据每组测试数据包含两行第一行代表string1第二行代表string2。
Output 对于每组输入数据对应输出连接后的字符串每组输出占一行。
Samples Sample #1 Input 123 654 abs sfg Output 123654 abssfg
分析
字符串连接函数strcat(char a,char b)
#include bits/stdc.h
#define ll long long
const int N 1e6 10;
using namespace std;
char s1[150],s2[150];
int n,t,m,j,i,sum;
int main(){while(cins1){cins2;strcat(s1,s2);couts1endl;}return 0;
}