这就是大D的人在OJ第一篇了,最水的一道题了。

 

Sum Problem
Time Limit: 1000/500 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)

Total Submission(s): 193577 Accepted Submission(s): 46347

 

Problem Description
Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).

 

Input
The input will consist of a series of integers n, one integer per line.

 

Output
For each case, output SUM(n) in one line, followed by a blank line. You may assume the result will be in the range of 32-bit signed integer.
Sample Input
1 100
Sample Output
1 5050

 

这可能是HDOJ上最水的一道题了,计算累加和。

这题有个坑,就是那输出的格式。。多少人因为这个倒在了1001面前啊。。

直接贴代码了。

 

版权声明
转载保留版权: 大D技研室 | 《[HDOJ]1001-Sum Problem》
本文链接地址:https://www.dadclab.com/archives/2857.jiecao
转载须知:如果您需要转载本文,请将版权信息,版权授权方式,以及本文的链接地址注明,谢谢合作。
本文被贴上了: , , , , 标签