题目地址:http://ac.jobdu.com/problem.php?pid=1063
//九度OJ 1063 清华机试之整数和。
//http://ac.jobdu.com/problem.php?pid=1063
#include <stdio.h>
#define MAXS 200
int main()
{
int n,flag,sum;
while(~scanf("%d",&n))
{
if(n>=0)flag=1;
else
{
flag=-1;
n=-n;
}
sum=n*(n+1)*3/2;
printf("%d\n",flag*sum);
}
return 0;
}