题解 | #牛牛学数列4#
牛牛学数列4
https://www.nowcoder.com/practice/586b114f52034688879342ba45779081
#include <stdio.h> int main() { int n = 0;//输入整数 scanf("%d", &n); int i = 0;//遍历 int sum = 0; for (i = 1; i <= n; i++) { int j = 0; int t= 0 ; for (j = 1; j<=i;j++) { t += j; } sum += t; } printf("%d\n", sum); return 0; }
C语言基础 文章被收录于专栏
里面较为详细的介绍了c语言的相关用法和有关题目。