HDOJ 1091 A+B for Input-Output Practice (III)
2015-10-22 16:01
651 查看
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
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
import java.util.*; class Main{ public static void main(String args[]){ Scanner sc =new Scanner(System.in); while(sc.hasNext()){ int a=sc.nextInt(); int b=sc.nextInt(); if(a==0&&b==0) return ; System.out.println(a+b); } } }
相关文章推荐
- HDOJ 1090 A+B for Input-Output Practice (II)
- HDOJ 1089 A+B for Input-Output Practice (I)
- Unix Network Programming(5)---SCTP
- 使用PHPmailer 发送邮件,使用QQ smtp服务器
- 禁用Cookie时,PHP共享Session文件解决方案
- ubuntu 14 server vsftp login incorrect 530
- php debug with xdebug xampp phpexcelipse
- php get_magic_quotes_gpc()函数用法介绍
- PHP编程效率的20个要点
- 通过quartz定时任务完成对FTP服务器上文档的下载
- [perl]ftpsync
- 在 Servlet 中,如果 parameter 的值不存在, getParameter 的返回值
- getParameter乱码
- viewpager 实现tab-----(viewpager + fragmentpageradapter)
- php 笔记
- 七牛云存储之图片的上传【PHP】
- 使用sublime进行PHP开发经验分享
- Yii源码解析之urlManger->parsePathInfo
- 教你用php制作一个缩略图教程
- thinkphp-后台模板里 所有商品分页显示和分类搜索分页显示