c
#include<stdio.h>
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
printf("%.f\n\n",(1+n)/2.0*n);
}
}
c
#include<stdio.h>
int main()
{
int i,n;
__int64 sum;
while(scanf("%d",&n)!=EOF)
{
sum=0;
for(i=1;i<=n;i++)
sum+=i;
printf("%I64d\n\n",sum);
}
return 0;
}

Original

posted on 2011-11-20 14:30  C's  阅读(102)  评论(0编辑  收藏  举报