用c语言编写a加b求和程序,请高手帮帮我编写这个求和的程序,用C语言Problem DescriptionHey,welcome to HDOJ(Hangzhou Dianzi University ...

b357216499010bdf2c78f9eb61d172be.png请高手帮帮我编写这个求和的程序,用C语言Problem DescriptionHey,welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem,your task is to calculate SUM(n) = 1 + 2 + 3 + ...+ n.InputThe input will consist of a series of i

2016-01-25

请高手帮帮我编写这个求和的程序,用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结束