A + B Problem

1001: A + B Problem


Description

计算 A + B.

 

Input

多组测试数据,每组测试数据占一行,包括2个整数。

 

Output

在一行中输出结果。

 

Sample Input

<span style="color:#333333"><span style="color:#333333">1 1
2 2
3 3
</span></span>

 

 

Sample Output

<span style="color:#333333"><span style="color:#333333">2
4
6
</span></span>

 

 

 

 

题目分析:水题,入门级

唯一的不同就是要用while判断输入是否结束,达到多组的效果。

 

 

 

#include <stdio.h>

int main()
{
	int a,b;
	while(scanf("%d %d",&a,&b)!=EOF)
	{
		printf("%d\n",a+b);
	}
	return 0;
}
全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务