题解 | 小乐乐计算函数
小乐乐计算函数
https://www.nowcoder.com/practice/89238e99c36e450786ccf3a9e7481b7b
#include <stdio.h>
int max3(int x,int y,int z){
int max =(((x>y)?x:y)>z)?((x>y)?x:y):z;
return max;
}
int main() {
int a = 0;
int b = 0;
int c = 0;
float m = 0;
scanf("%d %d %d",&a,&b,&c);
float max1 =max3(a+b,b,c);
float max2 =max3(a,b+c,c);
float max4 =max3(a,b,b+c);
m = max1/(max2+max4);
printf("%.2f",m);
return 0;
}

