A+B
Source : Unknown | |||
Time limit : 10 sec | Memory limit : 32 M |
Submitted : 20899, Accepted : 9893
for each pair of integers A and B ( 0 <= A,B <= 10) , Output the result of A+B on a single line.
Sample Input1 2 3 4Sample Output
3 7Sample Code
#include <stdio.h> int main(void) { int a, b; while (scanf("%d %d", &a, &b)==2) printf("%d\n",a+b); return 0; }
My solution:
#include<stdio.h>
int main()
{
int a,b;
while(scanf("%d%d",&a,&b) != EOF)
printf("%d\n",a+b);
return 0;
}
这道题很easy啦,就是注意下输入结束的标记是EOF就好了。