题解 | #牛牛学数列4#
牛牛学数列4
http://www.nowcoder.com/practice/586b114f52034688879342ba45779081
#include<stdio.h>
int main()
{
int n=0;
scanf("%d",&n);
int i=1;
int sum1=0;
int sum2=0;
for(i=1; i<n+1; i++)
{
sum1+=i;
sum2+=sum1;
}
printf("%d",sum2);
return 0;
}