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