题解 | #小乐乐计算求和#
小乐乐计算求和
https://www.nowcoder.com/practice/c98aeab2362c459dbc840d4c75f07729
#include<stdio.h> int f(int n) { return n == 1 ? 1 : n * f(n - 1); } int main(void) { int n; scanf("%d", &n); int sum = 0; for (int i = 1; i <= n; i++) sum += f(i); printf("%d", sum); return 0; }
c语言刷题 文章被收录于专栏
c语言刷题题目