Description:
Calculate a+b
Input:
Two integer a,b (0<=a,b<=10)
Output:
Output a+b
Sample Input:
1 2
Sample Output:
3 看起来很容易的对不对?但是真的没有想到竟然过不了~ 原因如下: 1.sample中“1 2”之间是空格! 2.看了别人的答案才知道要判断输入的数据是否到了结尾!深感不足~#include<stdio.h> using namespace std; int main() { int a,b; while(scanf("%d %d",a,b)!=EOF) { printf("%d",a+b); } return 0; }
2015.3.8
>
3210

被折叠的 条评论
为什么被折叠?



