C语言判断三个数的大小 用三目运算符

2024-11-28 19:24:18
推荐回答(2个)
回答(1):

#include
#include
int main()
{int a,b,c,d,e,f;
scanf("%d%d%d",&a,&b,&c);
d=a>b?(a>c?a:c):(b>c?b:c);
f=ae=a+b+c-d-f;
printf("%d %d %d\n",d,e,f);
return 0;
}

回答(2):

#include
int main(int argc,char*argv){
int a = 75;
int b = 30;
int c = 32;
printf("%d\n",a>b?(a>c?a:c):(b>c?b:c));
printf("%d\n",aprintf("%d\n",areturn 0;
}