ACM——A + B Problem (1)
A + B Problem (1)
总提交:5907 测试通过:1516
描述
Calculate a + b.
输入
The input will consist of a series of 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.
样例输入
1 5
样例输出
6
题目来源
ZOJ
#include<iostream>
#include<vector>
using namespace std;
int main(){
int i,a,b;
vector<int> ivec;
while(cin>>a>>b)
{
ivec.push_back(a+b);
}
for(i=;i<ivec.size();i++)
cout<<ivec[i]<<endl;
return ;
}
ACM——A + B Problem (1)的更多相关文章
- 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 (3)
Home Problems 1086 A + B Problem (3) 时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte总提交:2317 ...
- ACM——A + B Problem (2)
A + B Problem (2) 时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte总提交:2600 测试通过:137 ...
- 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 ...
随机推荐
- Ubuntu 安装Chrome步骤
一.添加PPA 从Google Linux Repository(http://www.google.com/linuxrepositories/)下载安装Key,或把下面的代码复制进终端,回车,需要 ...
- GotFocus和PreviewLeftButtonDown事件
当TextBox获得焦点后,其中的文字会被全选.通过GotFocus和PreviewLeftButtonDown事件,就可以模拟上述行为. 如果用户只是用键盘操作,GotFocus事件就足够了. 如果 ...
- POJ 1655 Balancing Act (求树的重心)
求树的重心,直接当模板吧.先看POJ题目就知道重心什么意思了... 重心:删除该节点后最大连通块的节点数目最小 #include<cstdio> #include<cstring&g ...
- Introduction to SignalR -摘自网络
What is SignalR? ASP.NET SignalR is a library for ASP.NET developers that simplifies the process of ...
- H.264 Profile、Level、Encoder三张简图 (fps = AVCodecContext->time_base.den / AVCodecContext->time_base.num)
H.264 Profiles Profiles are sets of capabilities. If your black box only supports the Baseline profi ...
- php排序之冒泡排序
冒泡排序比较简单.作为很多公司面试笔试题常常出现,要求手写该排序算法.双层循环,不断的与后面的比较,如果大于后面的,调换两者顺序即可. 演示效果如图: 代码如下: <?php function ...
- 字符串匹配之KMP算法
KMP算法使用前缀函数来模拟有限自动机的后缀函数,前缀函数通过计算模式与其自身的偏移匹配的信息,本身的证明很复杂,关键在于弄懂其核心思想,下面就不赘述了,仅仅贴出代码: #include <io ...
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
最近一直在学习SSM框架,今天遇到一个关于MyBatis生成的问题,记录一下. http://blog.csdn.net/zhshulin/article/details/37956105 我是根据这 ...
- 根据日期累加金额的mysql
今天遇到了一个语句,想了一会觉得有必要记录一下 问题描述 id money date 1 10 2015-01-012 20 2015-01-023 30 2015-01-034 40 2015-0 ...
- 解决libcrypto.so.0.9.8: cannot open shared object file
文章解决的问题:安装nginx中需要libmysql.so.16包的支持,下面介绍如何安装,并建立lib的连接. 问题展示:error while loading shared libraries: ...