用户名或电子邮箱地址
密码
记住我
A、可以任意 B、必须在程序的最开始 C、必须在系统调用的库函数的后面 D、必须在程序的最后 喵查答案:可以任意
#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; }
#include int MaxCommonFactor(int a, int b); int main() { int a, b, x; printf("Input a,b:"); scanf("%d,%d", &a, &b); x =_______________ ; if (x != -1) { printf("MaxCommonFactor = %d\n", x); } else { printf("Input error!\n"); } return 0; } //函数功能: 计算两个正整数的最大公约数,-1表示没有最大公约数 int MaxCommonFactor(int a, int b) { int r; if (a<=0 || b<=0) return -1; // 保证输入的参数为正整数 do{ ____________; a = b; _____________; }while (__________); return a; }