求阶乘y=1!+2!+3!+4!+ .+n!大神帮帮忙看看那里错了#include "stdio.h"int fun(int n){int i;int s;s=1;for(i=1;1
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/30 23:51:29
![求阶乘y=1!+2!+3!+4!+ .+n!大神帮帮忙看看那里错了#include](/uploads/image/z/12568586-50-6.jpg?t=%E6%B1%82%E9%98%B6%E4%B9%98y%3D1%21%2B2%21%2B3%21%2B4%21%2B+.%2Bn%21%E5%A4%A7%E7%A5%9E%E5%B8%AE%E5%B8%AE%E5%BF%99%E7%9C%8B%E7%9C%8B%E9%82%A3%E9%87%8C%E9%94%99%E4%BA%86%23include+%22stdio.h%22int+fun%28int+n%29%7B%05int+i%3B%05int+s%3B%05s%3D1%3B%05for%28i%3D1%3B1)
求阶乘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