原题地址: [ http://acm.hdu.edu.cn/showproblem.php?pid=1000 ]
代码地址: [ http://download.csdn.net/detail/angryn00b/5053087 ]
Problem Description
计算 A + B
Input
每行有2个整数 A 和 B, 并且需处理 EOF
Output
对每个输入都应有对应的每行输出A+B的值
Sample Input
1 1
Sample Output
2
#include <iostream>
using namespace std;
int main(void)
{
int A, B;
while (cin >> A >> B)
cout << A+B << endl;
return 0;
}
大家要注意处理EOF