首页 > 其他 > 详细

杭电1090(今天的汗水会是你明天的成长)

时间:2015-04-20 16:42:19      阅读:125      评论:0      收藏:0      [点我收藏+]
Problem Description
Your task is to Calculate a + b.
Input
Input contains an integer N in the first line, and then N lines follow. Each line consists of a pair of integers a and b, separated by a space, one pair of integers per line.
Output
For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input. 
Sample Input
2 1 5 10 20
 Sample Output
6 30
问题描述

你的任务是计算a + b。

输入

输入的第一行包含一个整数N,N,然后行。每一行包含一个整数a和b,之间用一个空格来分隔,每行一对整数。

输出

对于每一对输入整数a和b,你应该输出的总和a和b在一行,和一行输出输入的每一行

样例输入

2

1 5

10 20

样例输出

6

30

#include<stdio.h>
int main()
{
int n,a,b;
scanf("%d\n",&n);
while(scanf("%d%d",&a,&b)!=EOF)
{
printf("%d\n",a+b);
}
}

杭电1090(今天的汗水会是你明天的成长)

原文:http://www.cnblogs.com/woderenshengluwozijizou/p/4441831.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!