问题
问答题
#include<stdio.h>
int f1(int x,int y)return x>y x:y;)
int f2(int x,int y)return x>y y:x;
main()
int a=4,b=3,c=5,d=2,e,f,g;
e=f2(f1(a,b ),f1(c,d ));f=f1(f2(a,b ),f2(c,d ));
g=a+b+c+d-e-f;
printf("%d,%d,%d\n",e,f,g);
答案
参考答案:4,3,7
解析:
#include<stdio.h>
int f1(int x,int y){return x>y x:y;} /* 如果x>y则输出x*/
int f2(int x,int y){return x>y y:x;} /*如果x>y则输出y*/
main()
{
int a=4,b=3,c=5,d=2,e,f,g;
e=f2(f1(a,b ),f1(c,d ));f=f1(f2(a,b ),f2(c,d ));/*嵌套调用函数f1和f2*/
g=a+b+c+d-e-f;
printf("%d,%d,%d\n",e,f,g);
}