ZJUT 1001 A+B Problem
2013-05-27 18:46
211 查看
http://acm.zjut.edu.cn:8181/web/problem.php?id=1001
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, 0 0 means the end of the input, and do not need to output.
For each pair of input integers a and b you should output the sum of a and b in one line,and with one line of output for each line in input.
1 1
2 2
0 0
2
4
1001: A+B Problem
Description
Calculate A+B!
Input
The input will consist of a series of pairs of integers a and b,separated by a space, one pair of integers per line, 0 0 means the end of the input, and do not need to output.
Output
For each pair of input integers a and b you should output the sum of a and b in one line,and with one line of output for each line in input.
Sample Input
1 12 2
0 0
Sample Output
24
#include<iostream> using namespace std; int main() { int a,b; while(cin>>a>>b) { if(a==0&&b==0) break; cout<<a+b<<endl; } }
相关文章推荐
- hdu 1001 Sum Problem 的解题报告
- 百度之星资格赛 2016 Problem 1001
- 单调队列1001 HDU 3706 Second My Problem First 单调队列入门题
- ZOJ 1001 A + B Problem
- HDU 1001 Sum Problem
- HDOJ 1001 Sum Problem(java)
- HDU 1001 Sum Problem 水题
- HDU 1001 Sum Problem
- 搜索算法-二分搜索-方程解问题(problem 1001)
- BestCoder Round#29 1001 GTY's math problem
- 2017年ZJUT校赛-Problem A: 画图游戏——博弈论
- 杭电OJ-1001-(Sum Problem大整数求和问题)
- ChangChun_1001 A Simple Problem with Integers (HDU 4267)
- [1001]:Sum Problem(前n项和)
- HDU 1001 Sum Problem JAVA
- 二分查找 Problem 1001 Can you solve this equation?
- hdu 1001 Sum Problem 解题报告 数据范围
- 2017年ZJUT校赛-Problem B: 平方2——树状数组
- 洛谷1001 A+B Problem
- BestCoder Round #54 (div.2) HDU 5427 A problem of sorting(1001)