A+B for Input-Output Practice (VII)
时间: 1ms 内存:64M
描述:
Your task is to Calculate a + b.
输入:
The input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.
输出:
For each pair of input integers a and b you should output the sum of a and b, and followed by a blank line.
示例输入:
1 5
10 20
示例输出:
6
30
提示:
参考答案(内存最优[920]):
#include<stdio.h>
int main( )
{
int a,b;
while(scanf("%d %d",&a,&b)!=EOF)
printf("%d\n\n",a+b);
return 0;
}
参考答案(时间最优[0]):
#include<stdio.h>
int main( )
{
int a,b;
while(scanf("%d %d",&a,&b)!=EOF)
printf("%d\n\n",a+b);
return 0;
}
题目和答案均来自于互联网,仅供参考,如有问题请联系管理员修改或删除。