ACM——A + B Problem (3)
A + B Problem (3)
总提交:2317 测试通过:1452
描述
Calculate a + b.
输入
The input will consist of an integer N in the first line, and N pairs of integers a and b,separated by a space, one pair of integers per line.
输出
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.
样例输入
2
1 5
3 3
样例输出
6
6
题目来源
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int* r=new int[n];
int i,a,b;
for(i=;i<n;i++)
{
cin>>a>>b;
r[i]=a+b;
}
for(i=;i<n;i++)
cout<<r[i]<<endl;
return ;
}
ACM——A + B Problem (3)的更多相关文章
- ACM - a + b Problem
前几天看了ACM的第一题,映入眼帘的是一个“简单”的题目: 输入两个数,a,b 输出他们的和. 本着,此乃ACM的原则,便有了如下的思考: ACM的题目肯定很难,a+b,怎么可能直接printf,不行 ...
- ACM: A Simple Problem with Integers 解题报告-线段树
A Simple Problem with Integers Time Limit:5000MS Memory Limit:131072KB 64bit IO Format:%lld & %l ...
- ACM——A + B Problem (4)
A + B Problem (4) 时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte总提交:2496 测试通过:124 ...
- ACM——A + B Problem (2)
A + B Problem (2) 时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte总提交:2600 测试通过:137 ...
- ACM——A + B Problem (1)
A + B Problem (1) 时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte总提交:5907 测试通过:151 ...
- 2013年 ACM 有为杯 Problem I (DAG)
有为杯 Problem I DAG 有向无环图 A direct acylic graph(DAG),is a directed graph with no directed cycles . T ...
- ACM程序设计选修课——Problem E:(ds:图)公路村村通(优先队列或sort+克鲁斯卡尔+并查集优化)
畅通工程 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submi ...
- ACM程序设计选修课——Problem D: (ds:树)合并果子(最优二叉树赫夫曼算法)
Problem D: (ds:树)合并果子 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 80 Solved: 4 [Submit][Status][ ...
- 【ACM】hdu_zs3_1008_Train Problem I_201308100835
Train Problem I Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Tota ...
随机推荐
- MVC系统过滤器、自定义过滤器
一.系统过滤器使用说明 1.OutputCache过滤器 OutputCache过滤器用于缓存你查询结果,这样可以提高用户体验,也可以减少查询次数.它有以下属性: Duration:缓存的时间,以秒为 ...
- 开始同时在cnblog和BAE上写博客
研究生第一学期已过一半,开始理论学习,当然不能忘了实践学习. \[\frac{{ - b \pm \sqrt {{b^2} - 4ac} }}{{2a}}\]
- 一个赴美的应届毕业生Kevin,在美国做程序员的访谈
作者MUM计算机 转载请注明 在国内IT市场人才日渐饱和且竞争激烈的今天,作为一名代号996的程序猿,你是否也会对赴美工作心生向往呢?作为国内普通院校的应届本科生年薪就能轻松破40万 (人民币), ...
- 【HTML】Advanced3:Tables: Columns, Headers, and Footers
1. <table> <colgroup> <col> <col class="alternative"> <col> ...
- java 异常架构图
cu 红色为检查异常,就是eclipse要提示你是try catch 还是throws. 非检查异常,就是/0,nullpointexception,数据越界访问indexOfOutBounds 异常 ...
- HW4.10
public class Solution { public static void main(String[] args) { int count = 0; for(int i = 100; i & ...
- Yii 图片FTP批量上传 并生成缩略图
图片批量上传,前台使用 uploadify.swf,这个就不介绍了.这里使用两个扩展,一个是FTP上传的扩展,还有一个是生成缩略图的扩展地址:http://www.yiiframework.com/e ...
- Qt5.0.2无法发布问题
先从bin目录里面找到所缺失的dll,如果出现 可以找到libEGL.dll然后复制过来就可以了.
- oc学习之路----通过代码自定义cell
需求背景:由于tableView中每一个cell的数据与布局都不一样,故不能用xib实现功能,这是用代码写自定义cell就有必要了. 步骤 1.新建一个继承自UITableViewCell的类 2.重 ...
- html图片滚动效果
分享一个手动控制图片左右滚动的代码 先说html部分,建立一个层,写出他的样式,层中在建立一个小一点的层用来存放需要滚动的图片,小层两边再建两个小层用来存放控制图片左右滚动的按钮.代码如下: 样式表: ...