题解 | #牛牛学数列4#
牛牛学数列4
https://www.nowcoder.com/practice/586b114f52034688879342ba45779081
int main() {
int result = 0, temp = 0, n;
while (scanf("%d", &n) != EOF) {
for (int i = 1; i <= n; i++) {
temp += i;
result += temp;
}
}
printf("%d\n", result);
return 0;
}