[An AC a day]1001_HIT_ACM
2013-12-31 00:28
330 查看
A+B
My Tags | (Edit) |
---|
Source : Unknown | |||
Time limit : 10 sec | Memory limit : 32 M |
for each pair of integers A and B ( 0 <= A,B <= 10) , Output the result of A+B on a single line.
Sample Input
1 2 3 4
Sample Output
3 7
Sample 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就好了。
相关文章推荐
- [An AC a day]1004_HIT_ACM
- [An AC a day]1002_HIT_ACM
- [An AC a day]1003_HIT_ACM
- [An AC a day]1088_POJ_ACM
- [An AC a day]2084_HDU_ACM
- [An AC a day]1050_POJ_ACM
- [An AC a day]3624_POJ_ACM
- [An AC a day]1160_HDU_ACM
- [An AC a day]1160_HDU_ACM
- [An AC a day]1421_HDU_ACM
- ACM 粗心永远AC不了系列——Demo Day|三维DP问题,机器人寻路,hiho一下第150周
- YT04-贪心课堂练习-1001 今年暑假不AC-(6.14日-烟台大学ACM预备队解题报告)
- [An AC a day]Daily Practice_BIT
- An ac a day,keep wa away
- 杭电ACM 1001
- HDU_ACM_1001
- 每天做两道杭电acm——1000,1001
- ACM水题-AB串(AC,分情况,要小心陷阱,两种思路)
- ACM杭电的AC回顾——2025
- ACM杭电的AC回顾——2029