HDOJ-1001 Sum Problem

http://acm.hdu.edu.cn/showproblem.php?pid=1001

# include <stdio.h>

int main ()
{
	int n;
	while(scanf("%d",&n) != EOF)
	{
		int Sum = 0;
		for(int i = 1; i <= n; i++)
			Sum += i;
		printf("%d\n\n",Sum);
	}

	return 0;
}

  

posted @ 2015-02-20 16:05  懒人の猫  阅读(95)  评论(0编辑  收藏  举报