请高手帮帮我编写这个求和的程序,用C语言
2018-5-27来自ip:10.126.170.225的网友咨询
浏览量:153
问题补充:
请高手帮帮我编写这个求和的程序,用C语言
Problem Description
Hey,welcome to HDOJ(Hangzhou Dianzi University Online Judge).
In this problem,your task is to calculate SUM(n) = 1 + 2 + 3 + ...+ n.
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
/*请注意几点,第一,可以一直输入并且每个输入占一行.第二,当输入完毕之后才将结果一起输出,且每个输出结果占一行,并且后边跟着一个空行.*\
使用EOF的方法,是ctl+z结束