标签:
HDOJ10001 Sum Problem
Accepted.
代码如下:
#include<stdio.h>
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
int i,sum = 0;
for(i=1;i<=n;i++)
{
sum+=i;
}
printf("%d\n\n",sum);
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/wudongyang/p/4333656.html