问题 A: 字符串连接

题目描述

不借用任何字符串库函数实现无冗余地接受两个字符串,然后把它们无冗余的连接起来。

输入

每一行包括两个字符串,长度不超过100。

输出

可能有多组测试数据,对于每组数据,
不借用任何字符串库函数实现无冗余地接受两个字符串,然后把它们无冗余的连接起来。
输出连接后的字符串。

样例输入

abc def

样例输出

abcdef

#include<stdio.h>
int main(){
	char a[2][101];
	int n=0;
	while(scanf("%s", a[n])!=EOF){
		n++;
		if(n==2){
			for(int i=0; i<n; i++){
				printf("%s", a[i]);
			}
			printf("\n");
			n=0;
		}
	}
	return 0;
}


猜你喜欢

转载自blog.csdn.net/chuyuan_li/article/details/80955392
今日推荐