题解 | 小乐乐计算函数

小乐乐计算函数

https://www.nowcoder.com/practice/89238e99c36e450786ccf3a9e7481b7b

#include <stdio.h>

int max3(int a, int b, int c)
{
    int max = a;
    if (b > max)
        max = b;
    if (c > max)
        max = c;
    return max;
}

int main() 
{
    int a = 0;
    int b = 0;
    int c = 0;
    while (scanf("%d %d %d", &a, &b, &c) == 3)
    {
        float m = 0;
        m = max3(a + b, b, c) * 1.0 /(max3(a, b + c, c) + max3(a, b, b + c));
        printf("%.2f\n", m);
    }
    return 0;
}

全部评论

相关推荐

牛客66512506...:那个百度acg是不是个小哥啊,老是问些底层问题狠狠为难,然后kpi
哪些公司在招寒假实习?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务