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