题解 | #小乐乐计算函数#

小乐乐计算函数

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

#include<stdio.h>
int Max(int a, int b, int c) {
    int max = a;
    if (max < b)
        max = b;
    if (max < c)
        max = c;
    return max;
}


int main() {
    int a, b, c;
    float m = 0.0;
    scanf("%d %d %d", &a, &b, &c);
    int ret = Max(a + b, b, c);
    int ret2 = Max(a, b + c, c);
    int ret3 = Max(a, b, b + c);
    m = (float) ret / (ret2 + ret3);
    printf("%.2f", m);
    return 0;
}

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-09 11:15
点赞 评论 收藏
分享
苍蓝星上艾露:这简历。。。可以试试我写的开源简历优化工具https://github.com/weicanie/prisma-ai
点赞 评论 收藏
分享
Beeee0927:是缅甸园区吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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