题解 | #小乐乐计算函数#
小乐乐计算函数
http://www.nowcoder.com/practice/89238e99c36e450786ccf3a9e7481b7b
#include<stdio.h>
int max3(int g, int h, int i) { int max = g>h?g:h; max = max>i?max:i; return max; }
int main() { int a,b,c,d,e,f; float k; scanf("%d %d %d", &a,&b,&c); d=max3(a+b,b,c); e=max3(a,b+c,c); f=max3(a,b,b+c); printf("%.2f",k = k = (float)d / (float)(e + f)); return 0; }