求阶乘y=1!+2!+3!+4!+ .+n!大神帮帮忙看看那里错了#include "stdio.h"int fun(int n){int i;int s;s=1;for(i=1;1

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/05 19:08:02

求阶乘y=1!+2!+3!+4!+ .+n!大神帮帮忙看看那里错了#include "stdio.h"int fun(int n){int i;int s;s=1;for(i=1;1
求阶乘y=1!+2!+3!+4!+ .+n!大神帮帮忙看看那里错了
#include "stdio.h"
int fun(int n)
{
int i;
int s;
s=1;
for(i=1;1

求阶乘y=1!+2!+3!+4!+ .+n!大神帮帮忙看看那里错了#include "stdio.h"int fun(int n){int i;int s;s=1;for(i=1;1
1.你求阶乘的函数按正确的来说应该要考虑0在内,对于题目给的可以不用
2.你的主函数中,s初值应该是0,表示初始之和为0.你初值为2会使你求的结果比真实结果大2
3.你主函数中for循环应该改为for (k=1;k