[1091]:A+B for Input-Output Practice (III)
2015-11-15 13:45
701 查看
A+B for Input-Output Practice (III)
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 91321 Accepted Submission(s): 47839
Problem Description
Your task is to Calculate 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.
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 5
10 20
0 0
Sample Output
6
30
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 91321 Accepted Submission(s): 47839
Problem Description
Your task is to Calculate 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.
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 5
10 20
0 0
Sample Output
6
30
#include<stdio.h> int main() { int num1, num2; while(scanf("%d%d", &num1, &num2)!=EOF){ if(num1==0 && num2==0){ continue; } printf("%d\n", num1+num2); } return 0; }
相关文章推荐
- [1090]:A+B for Input-Output Practice (II)
- [1089]:A+B for Input-Output Practice (I)
- php的安装配置
- php和html混写,遍历出二维关联数组
- php面向对象--多态
- php性能优化
- editplus移植U盘计划
- PHP程序中字符串的使用
- (PHP)正则表达式-preg_quote-转义正则表达式字符的用法
- (PHP)正则表达式-preg_split函数的用法
- 实现多个ContentProvider对多张表进行操作
- PHP程序中命名空间的使用
- php中类的继承
- PHP 判断指定IP,是否在一个IP段里
- 4步win7下简单FTP服务器搭建(试验成功)
- php处理图像的函数
- 产品列表页分类筛选、排序的算法实现(PHP)
- Laravel学习实践(三)Laravel发送邮件
- zendstudio 出现failed to create the java machine转
- Mac平台搭建php平台