用户名或电子邮箱地址
密码
记住我
A、可以任意 B、必须在程序的最开始 C、必须在系统调用的库函数的后面 D、必须在程序的最后 喵查答案:可以任意
#include int MaxValue(int x, int y) { return x>y? x:y; } int MinValue(int x,int y) { return x>y? y:x; } int main() { int a=4,b=3,c=5,d,e,f; d=MaxValue(a,b); d=MaxValue(d,c); e=MinValue(a,b); e=MinValue(e,c); f=a+b+c-d-e; printf("%d,%d,%d\n",d,f,e); return 0; }
#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; }