HDOJ 1090 A+B for Input-Output Practice (II)
2016-01-28 08:04
525 查看
Problem Description
Your task is to Calculate a + b.
Input
Input contains an integer N in the first line, and then N lines follow. Each line consists of a pair 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
Sample Output
Your task is to Calculate a + b.
Input
Input contains an integer N in the first line, and then N lines follow. Each line consists of a pair 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
2 1 5 10 20
Sample Output
6 30
// // main.cpp // A+B for Input-Output Practice (II) // // Created by 张嘉韬 on 16/1/28. // Copyright © 2016年 张嘉韬. All rights reserved. // #include <iostream> using namespace std; int main(int argc, const char * argv[]) { int n; cin>>n; for(int t=1;t<=n;t++) { int a,b; cin>>a>>b; cout<<a+b<<endl; } return 0; }
相关文章推荐
- HDOJ 1089 A+B for Input-Output Practice (I)
- 实例详解PHP中html word 互转的方法
- 【嘉兴东臣php】php
- php7编译swoole
- PHP连接MySQL之原生MySQL函数总结
- PHP——修改数据库2-加提示框,加登录页面
- PHP之进制转换
- 编译php-5.5.15出错,xml2-config not found
- [总结]PHP面向对象
- Hbase启动时无法启动HRegionServer进程
- PHP实现中文名称文件下载
- PHP强制转换类型
- PHP——转义字符
- PHP学习之MySql函数·微型博客
- php中error与exception的区别及应用
- PHP小函数
- 学习Slim Framework for PHP v3 (六)--route怎么被匹配的?
- Thinkphp结合PHPMailer发邮件
- ubuntu14.04 server ftp 服务安装配置详解
- ubuntu14.04 server ftp 服务安装配置详解