HDOJ 1089 A+B for Input-Output Practice (I)
2015-10-22 15:59
495 查看
Problem Description
Your task is to Calculate a + b.
Too easy?! Of course! I specially designed the problem for acm beginners.
You must have found that some problems have the same titles with this one, yes, all these problems were designed for the same aim.
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.
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
Sample Output
6
30
Your task is to Calculate a + b.
Too easy?! Of course! I specially designed the problem for acm beginners.
You must have found that some problems have the same titles with this one, yes, all these problems were designed for the same aim.
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.
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
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(); System.out.println(a+b); } } }
相关文章推荐
- 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-后台模板里 所有商品分页显示和分类搜索分页显示
- php 字符串 以 开头 以结尾 startWith endWith
- PHP stristr()函数