#1000 A + B (hihoCoder)
描述
求两个整数A+B的和
输入
输入包含多组数据。
每组数据包含两个整数A(1 ≤ A ≤ 100)和B(1 ≤ A ≤ 100)。
输出
对于每组数据输出A+B的和。
- 样例输入
- 样例输出
实现代码:
#include <stdio.h>
int main(int argc, char *argv[]){
int i, len=;
int *A=new int[];
int *B=new int[];
int *C=new int[];
while((i=scanf("%d %d", A+len, B+len))==){
len++;
}
for(i=; i<len; i++){
C[i]=A[i]+B[i];
printf("%d\n", C[i]);
}
return ;
}
注意:scanf()函数返回成功赋值的数据项数,读到文件末尾出错时则返回EOF。
#1000 A + B (hihoCoder)的更多相关文章
- hihoCoder#1000
刚开始学习C语言,准备在做hiho的题目的过程中来学习,在此进行记录,如果代码中有错误或者不当的地方还请指正. 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 求两个整 ...
- [HihoCoder] Highway 高速公路问题
Description In the city, there is a one-way straight highway starts from the northern end, traverses ...
- hihocoder 1084 扩展KMP && 2014 北京邀请赛 Justice String
hihocoder 1084 : http://hihocoder.com/problemset/problem/1084 北京邀请赛 Just String http://www.bnuoj.co ...
- hihocoder #1223 : 不等式 水题
#1223 : 不等式 Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://hihocoder.com/problemset/problem/1223 ...
- [ An Ac a Day ^_^ ] HihoCoder 1249 Xiongnu's Land 线性扫描
拿到了icpc北京站的参赛名额 感谢亮哥~ 虽然是地狱之战 但也要全力以赴! 题意: 有一片沙漠 n片绿洲 让你用一条线分成两部分 左≥右 而且分割线要尽量靠右 问线的位置 思路: 网上说可以二分 没 ...
- hihoCoder #1043 : 完全背包(板子题)
#1043 : 完全背包 时间限制:20000ms 单点时限:1000ms 内存限制:256MB 描述 且说之前的故事里,小Hi和小Ho费劲心思终于拿到了茫茫多的奖券!而现在,终于到了小Ho领取奖励的 ...
- hihoCoder #1038 : 01背包(板子题)
#1038 : 01背包 时间限制:20000ms 单点时限:1000ms 内存限制:256MB 描述 且说上一周的故事里,小Hi和小Ho费劲心思终于拿到了茫茫多的奖券!而现在,终于到了小Ho领取奖励 ...
- hihoCoder #1498 : Diligent Robots【数学】
#1498 : Diligent Robots 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 There are N jobs to be finished. It t ...
- hihocoder 1388 fft循环矩阵
#1388 : Periodic Signal 时间限制:5000ms 单点时限:5000ms 内存限制:256MB 描述 Profess X is an expert in signal proce ...
随机推荐
- Linux命令:screen
①杀死detached状态的会话: $ screen -X -S [session # you want to kill] quit
- FirstUniqueCharacterInString
Given a string, find the first non-repeating character in it and return it's index. If it doesn't ex ...
- IT关键词,发现与更新,点成线,线成面,面成体
时序图 1.什么是时序图 2.如何看懂时序图 3.时序图的作用 4.如何绘制时序图 分布式 一个业务分拆多个子业务,部署在不同的服务器上. 分布式是指将不同的业务分布在不同的地方. 而集群指的是将几台 ...
- RecyclerView 滑动检测 (上滑 up)(下滑 down)(顶部 top)(底部 bottom)
RecyclerView 给我们的可以检测滑动事件的接口 只有 一个方法 recyclerview.setOnScrollListener()或者 recyclerview.addOnScroll ...
- commons-io ProxyInputStream,ProxyOutputStream,ProxyReader,ProxyWriter
1.ProxyInputStream: A Proxy stream which acts as expected, that is it passes the method calls on to ...
- python多线程
python多线程有两种用法,一种是在函数中使用,一种是放在类中使用 1.在函数中使用 定义空的线程列表 threads=[] 创建线程 t=threading.Thread(target=函数名,a ...
- java获取年份的后两位
public static String getDate(Date strDate) { String date = null; if (strDate!= null) { Calendar star ...
- HTML语言学习笔记(会更新)
# HTML语言学习笔记(会更新) 一个html文件是由一系列的元素和标签组成的. 标签: 1.<html></html> 表示该文件为超文本标记语言(HTML)编写的.成对出 ...
- Sprint1(第七天11.20)
Sprint1(11.20) Sprint1第一阶段 1.类名:软件工程-第一阶段 2.时间:11.14-11.23 3.选题内容:web版-餐厅到店点餐系统 4.我们详细分析了点餐系统实现的具体 ...
- JAV07接口与继承之动手动脑问题解决
动手动脑:请自行编写代码测试以下特性:在子类中,若要调用父类中被覆盖的方法,可以使用super关键字. 1.源代码: package Work; class A{ public A(){ System ...