#include <stdio.h>
#include <stdlib.h>
void main()
{ while (1) { int i, n; int total = 0; printf("输入n的值"); scanf("%d", &n); for (i = 1; i <= n; i++) total += i*i; printf("输出总和%d", total); system("pause"); }
}
#include<stdio.h>
int main(void) {
int n, m;
long sum=0;
scanf("%ld", &n);
for (int i = 1; i <= n; i++) {
m = i;
for (int j = 0; j < m; j++)
sum += m;
}
printf("%ld\n", sum);
return 0;
}