码迷,mamicode.com
首页 > 其他好文 > 详细

A+B problems

时间:2017-11-04 20:45:59      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:ons   space   ace   sep   should   lin   style   can   ack   

这几道习题大概是ACM输入输出格式的普及

P1:
-------------------------------------------------------------------------------------------------------------------------------------------------
Input:
The input will consist of a series of pairs 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
1 5
10 20

Sample Output
6
30
-------------------------------------------------------------------------------------------------------------------------------------------------
Code:
int main()
{
int a,b;
while("scanf("%d %d",&a,&b)==2")
printf("%d\n",a+b);
return 0;
} //简单的用while来控制多组数据的输入

A+B problems

标签:ons   space   ace   sep   should   lin   style   can   ack   

原文地址:http://www.cnblogs.com/wuruofeng/p/7784197.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!