A+B problems
Posted Rohlf
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了A+B problems相关的知识,希望对你有一定的参考价值。
这几道习题大概是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的主要内容,如果未能解决你的问题,请参考以下文章
理解 Python 交换:为啥 a, b = b, a 并不总是等价于 b, a = a, b?
为啥“a+++++b”不能在gcc中编译,而“a+++b”、“a++ + ++b”、“a+++ ++b”可以? [复制]
1.python的 a,b=b,a+b 和 a=b b=a+b 的区别