「HD_ACM」A+B for Input-Output Practice (III)
来源:互联网 发布:sql 数据库链接 编辑:程序博客网 时间:2024/05/02 01:51
Problem Description
Your task is to Calculate a + b.
->你的任务是计算A +B
Input
Input contains multiple test cases. Each test case contains a pair of integers a and b, one pair of integers per line. A test case containing 0 0 terminates the input and this test case is not to be processed.
->输入包含多个测试案例。每个测试用例包含一对整数a和b,每行一个整数对。一个包含0个0终止输入和测试用例是不能处理的测试用例。
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.
->对于每一对输入整数a和b你应该输出一行,a和b的值,并用一行输出在一行。
题目解析
注意a 和 b 同时为0 的时候才退出程序,
代码解析
#include <stdio.h>#include <stdlib.h>int main(){ int a, b; while(scanf("%d %d" , &a ,&b) !=EOF && a !=0 || b != 0) { printf("%d\n" , a+b); } return 0;}
0 0
- 「HD_ACM」A+B for Input-Output Practice (III)
- 「HD_ACM」 A+B for Input-Output Practice (I)
- 「HD_ACM」 A+B for Input-Output Practice (II)
- 「HD_ACM」A+B for Input-Output Practice (IV)
- 「HD_ACM」A+B for Input-Output Practice (V)
- 「HD_ACM」A+B for Input-Output Practice (VI)
- 「HD_ACM」A+B for Input-Output Practice (VII)
- 「HD_ACM」A+B for Input-Output Practice (VIII)
- A+B for Input-Output Practice (III)
- A+B for Input-Output Practice (III)
- A+B for Input-Output Practice (III)
- A+B for Input-Output Practice (III)
- A+B for Input-Output Practice (III)
- A+B for Input-Output Practice (III)
- A+B for Input-Output Practice (III)
- A+B for Input-Output Practice (III)
- A+B for Input-Output Practice (III)
- A+B for Input-Output Practice (III)
- 在Eclipse中查看JDK类库的源代码!!!
- Hello Kiki(hdu3579+不互质的中国剩余定理)
- android环境下摄像头数据采集及显示
- oracle中修改表名
- 用Python和Pygame写游戏-从入门到精通(22)
- 「HD_ACM」A+B for Input-Output Practice (III)
- window命令行的cd
- HDU 2018
- Stall Reservations - POJ3190 贪心
- 诸葛亮兵书
- 字符串的全排列(未解决)
- UIImage 所支持的图片类型
- Maven项目下HttpServletRequest 或 HttpServletResponse需引用的依赖包
- ponyDebugger 使用感悟