[C] Re: Re: Re: Re: Re: c语言 求n!,即计算1×2×3×...×n的值 阶乘 →→→→→进入此内容的聊天室

#include<stdio.h>
void factorial()
 
 int main()
{
    int number;
    int factorial 
n, m 1;
    
1, pro;
    long fact(int);//???????
    printf("Input n:");
    
scanf_s("%d", &number);
    for(int i=1; i<=number; i++) 
    {
        factorial 
&n);
    for (; m <= n; m++)
        pro 
i*factorial;//?????number=0????????1
    }
    printf("%d ", factorial);
fact(m);
    printf("%d!=%ld\n", n, pro);
}
int main()
 
long fact(int n)
{
    factorial();//<==>???????????????????????????
static long pro = 1;//pro?product---??
    pro = pro * n;
    return(pro);
}

回复 "Re: Re: Re: Re: Re: c语言 求n!,即计算1×2×3×...×n的值 阶乘"

这儿你可以回复上面这条便签

captcha