输入m,k的值,编程求下面表达式的值:(要求编写一个求阶乘的函数,调用函数实现本题)p=k!/(m-k)!
#include<stdio.h>unsignedlongFactorial(unsignedintnumber);main(){unsignedintm,k;doubl...
#include <stdio.h>
unsigned long Factorial(unsigned int number);
main()
{ unsigned int m, k;
double p;
printf("Please input m, k:");
scanf("%u, %u", &m, &k);
p = (double)Factorial(k) / Factorial (m-k);
printf("p=%f\n", p);
}
unsigned long Factorial(unsigned int number)
{
} 展开
unsigned long Factorial(unsigned int number);
main()
{ unsigned int m, k;
double p;
printf("Please input m, k:");
scanf("%u, %u", &m, &k);
p = (double)Factorial(k) / Factorial (m-k);
printf("p=%f\n", p);
}
unsigned long Factorial(unsigned int number)
{
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询