编程计算下面组合数的值" title="编程计算下面组合数的值代码如下,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。#include
_________________________;
int main()
{
int m, k;
_________;
do{
printf("Please input m,k (m>=k>0):");
scanf("%d, %d", &m, &k);
} while (______________);
p = (double)Factorial(m) / (Factorial(k) * Factorial (m-k));
printf("p=%.0f\n", p);
return 0;
}
//函数功能:计算无符号整型数number的阶乘
unsigned long Factorial(unsigned int number)
{
unsigned long i, result = 1;
for (________________)
{
result *= i;
}
return result;
}
" width="173" height="53" />代码如下,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。
#include
_________________________;
int main()
{
int m, k;
_________;
do{
printf("Please input m,k (m>=k>0):");
scanf("%d, %d", &m, &k);
} while (______________);
p = (double)Factorial(m) / (Factorial(k) * Factorial (m-k));
printf("p=%.0f\n", p);
return 0;
}
//函数功能:计算无符号整型数number的阶乘
unsigned long Factorial(unsigned int number)
{
unsigned long i, result = 1;
for (________________)
{
result *= i;
}
return result;
}
A、第2行: unsigned long Factorial(unsigned int number)第6行: double p第11行: m<k || m<0 || k<0第23行: i=2; i<=number; i++
B、第2行: long Factorial(unsigned int number)第6行: double p第11行: m<k || m<0 || k<0第23行: i=1; i<number; i++
C、第2行: unsigned long Factorial(int number)第6行: int p第11行: m<k && m<0 && k<0第23行: i=2; i<=number; i++
D、第2行: unsigned Factorial(unsigned number)第6行: int p第11行: m<k || m<0 || k<0第23行: i=1; i<=number; i++
喵查答案:第2行: unsigned long Factorial(unsigned int number)第6行: double p第11行: m<k || m<0 || k<0第23行: i=2; i<=number; i++