【ACM】hdu_1092_A+BIV_201307261630
A+B for Input-Output Practice (IV)
Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 50209    Accepted Submission(s): 26940
Problem Description
Your task is to Calculate the sum of some integers.
Input
Input contains multiple test cases. Each test case contains a integer N, and then N integers follow in the same line. A test case starting with 0 terminates the input and this test case is not to be processed.
Output
For each group of input integers you should output their sum in one line, and with one line of output for each line in input.
Sample Input
4 1 2 3 4
5 1 2 3 4 5
0
Sample Output
10
15
#include <stdio.h>
int main()
{int n;
 while(scanf("%d",&n),n)
 {int a,sum=0;
  while(n--)
  {scanf("%d",&a);
   sum+=a;
  }
  printf("%d\n",sum);
 }
 return 0;
}
【ACM】hdu_1092_A+BIV_201307261630的更多相关文章
- 高手看了,感觉惨不忍睹——关于“【ACM】杭电ACM题一直WA求高手看看代码”
		
按 被中科大软件学院二年级研究生 HCOONa 骂为“误人子弟”之后(见:<中科大的那位,敢更不要脸点么?> ),继续“误人子弟”. 问题: 题目:(感谢 王爱学志 网友对题目给出的翻译) ...
 - 【ACM】HDU1008 Elevator 新手题前后不同的代码版本
		
[前言] 很久没有纯粹的写写小代码,偶然想起要回炉再来,就去HDU随便选了个最基础的题,也不记得曾经AC过:最后吃惊的发现,思路完全不一样了,代码风格啥的也有不小的变化.希望是成长了一点点吧.后面定期 ...
 - 【ACM】魔方十一题
		
0. 前言打了两年的百度之星,都没进决赛.我最大的感受就是还是太弱,总结起来就是:人弱就要多做题,人傻就要多做题.题目还是按照分类做可能效果比较好,因此,就有了做几个系列的计划.这是系列中的第一个,解 ...
 - 【ACM】那些年,我们挖(WA)过的最短路
		
不定时更新博客,该博客仅仅是一篇关于最短路的题集,题目顺序随机. 算法思想什么的,我就随便说(复)说(制)咯: Dijkstra算法:以起始点为中心向外层层扩展,直到扩展到终点为止.有贪心的意思. 大 ...
 - 【ACM】不要62 (数位DP)
		
题目:http://acm.acmcoder.com/showproblem.php?pid=2089 杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer).杭州交通管理局经常会扩充一些的士车牌照,新 ...
 - 【Acm】八皇后问题
		
八皇后问题,是一个古老而著名的问题,是回溯算法的典型例题. 其解决办法和我以前发过的[算法之美—Fire Net:www.cnblogs.com/lcw/p/3159414.html]类似 题目:在8 ...
 - 【ACM】hud1166 敌兵布阵(线段树)
		
经验: cout 特别慢 如果要求速度 全部用 printf !!! 在学习线段树 内容来自:http://www.cnblogs.com/shuaiwhu/archive/2012/04/22/24 ...
 - 【acm】杀人游戏(hdu2211)
		
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2211 杀人游戏 Time Limit: 3000/1000 MS (Java/Others) M ...
 - 【ACM】How many prime numbers
		
http://acm.hdu.edu.cn/game/entry/problem/show.php?chapterid=2§ionid=1&problemid=2 #inclu ...
 
随机推荐
- struts2结果处理、获取参数(二)
			
结果处理 1.转发 type可以不写,默认就是转发 <package name="hello" namespace="/hello" extends=&q ...
 - AFN请求后台返回数据为NSInlineData类型的处理
			
在利用AFN进行数据解析时出现返回数据为 <7b227374 61747573 223a302c 226d6573 73616765 223a22e6 82a8e79a 84e6898b e69 ...
 - 总结Linq或者lamdba的写法
			
var head = new OmsEcorderHead { PkEcorderHead = OrderHeadId, AppId = appid, Integral = Convert.ToDec ...
 - Linux之tar.gz file
			
A tarball (tar.gz file) is compressed tar archive. The tar program provides the ability to create ta ...
 - Python3爬虫----爬取网页内的图片
			
无聊把公司内网爬了一遍. https://github.com/gig886/Python/tree/master/爬虫
 - error C3859: 超过了PCH的虚拟内存范围;请使用“-Zm33”或更大的命令行选项重新编译
			
编译 ORB_SLAM的Release版本时,出现了此问题: 错误 2 error C3859: 超过了 PCH 的虚拟内存范围;请使用"-Zm465"或更大的命令行 修改方法: ...
 - C++的Android接口---配置NDK
			
一. 在安卓工具网站下载ADT:http://tools.android-studio.org/index.php 参考链接:http://1527zhaobin.iteye.com/blog/186 ...
 - react基础篇二
			
组件 & Props & 生命周期 组件可以将UI切分成一些独立的.可复用的部件,这样你就只需专注于构建每一个单独的部件. 组件从概念上看就像是函数,它可以接收任意的输入值(称之为“p ...
 - 【sqli-labs】 less30 GET- Blind -Impidence mismatch -Having a WAF in front of web application (GET型基于盲注的带有WAF注入)
			
这次是双引号的,WAF绕过方法不变 http://192.168.136.128/sqli-labs-master/Less-30/login.php?id=1&id=2" and ...
 - 前端工具gulp2
			
var gulp = require('gulp'); var less = require('gulp-less'); var htmlmin = require('gulp-htmlmin'); ...