解题思路:
注意事项:
参考代码:
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
int s = 0, a;
printf("输入项数");
scanf_s("%d", &a);
for (int i = 0; i < a; i++)
{
int all = 1;
for (int x = 0; x <= i; x++)
all *= (x + 1);
s = s + all;
}
printf("阶乘之和为%d", s);
system("pause");
return 0;
}
0.0分
1 人评分
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)万恶的long long浏览:882 |
【排队买票】 (C语言代码)浏览:900 |
剪刀石头布 (C语言代码)浏览:1755 |
2005年春浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:591 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:594 |
Hello, world! (C语言代码)浏览:715 |
Tom数 (C语言代码)浏览:527 |
C二级辅导-求偶数和 (C语言代码)浏览:674 |
整除问题 (C语言代码)浏览:526 |
神奇的fans (C语言代码)浏览:989 |