ACM——A + B Problem (2)
A + B Problem (2)
总提交:2600 测试通过:1372
描述
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. A line containing 0 0 terminates the input and this line is not to be processed.
输出
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
3 3
0 0
样例输出
6
6
题目来源
HDUOJ
#include<iostream>
#include<vector>
using namespace std;
int main(){
int i,a,b;
vector<int> ivec;
while(cin>>a>>b)
{
if(a==&&b==)
break;
ivec.push_back(a+b);
}
for(i=;i<ivec.size();i++)
cout<<ivec[i]<<endl;
return ;
}
ACM——A + B Problem (2)的更多相关文章
- 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 (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 ...
随机推荐
- lua部分 tips
lua文件刷新 function require_ex( _mname ) if _mname == "" then return end if package.loaded[_m ...
- [codevs]失恋28天题目系列
失恋28天-追女孩篇 题目描述 Description 呵呵,相信大家失恋33天都看过吧,里面的主人公黄小仙和王小贱都有印象吧!这回我要给大家讲的是我 们班同学的失恋经历,呵呵他总共失恋了28天.但是 ...
- 【HTML】Intermediate4:Tables:rowspan and colspan
1.</th> header cell As with td elements,these must be enclosed inside tr elements 2.</tr co ...
- HDOJ-ACM1425 sort 简单hash应用
其实快排也可以通过这个问题~不是考点 没想到考点是这个,简单hash应用,空间换时间 初始化一个长度为1000001的数组(由于数字的范围为[-500000,500000]) 如果存在这个数m,数组下 ...
- CF_402F dp+组合数学
题目链接:http://codeforces.com/problemset/problem/403/D /**算法分析: 这道题综合的考察了dp背包思想和组合数学 */ #include<bit ...
- python —print
今天开始学python了,“装X”安装了最新版本python 3.4.1 然后,print “hello world!" 就出错了... 一搜原来... python v3.0以后的版本pr ...
- 输出数组里面第N大的数
好像有些大公司出过面试题:找出数组里面第N大的数,当然有点变化,但本质部分是这样的. 要求是不能排序,时间复杂度不能超过O(n^2) 思路很多,我暂时就只会快排衍生的那种.如果对快速排序不太熟悉了,建 ...
- 基于 OAuth 安全协议的 Java 应用编程1
原文地址:http://www.ibm.com/developerworks/cn/java/j-lo-oauth/index.html 參考博客:http://www.cnblogs.com/wan ...
- Lucene教程具体解释
(建立索引)] )中生成的索引文件的存放地址.详细步骤简单介绍例如以下: 1.创建Directory对象,索引目录 2.创建IndexSearch对象,建立查询(參数是Directory对象) 3.创 ...
- [GIF] Shape Objects in GIF Loop Coder
This lesson is a quick tour of the predefined shape objects in GIF Loop Coder. function onGLC(glc) { ...