hdu 1001 Sum Problem
#include<stdio.h>
int main(void)
{
int n;
while(scanf("%d",&n)!=EOF)
if(n%2)
printf("%d\n\n",(n+1)/2*n);
else printf("%d\n\n",n/2*(n+1));
return 0;
}
#include<stdio.h>
int main(void)
{
int n;
while(scanf("%d",&n)!=EOF)
if(n%2)
printf("%d\n\n",(n+1)/2*n);
else printf("%d\n\n",n/2*(n+1));
return 0;
}