题解 | 小乐乐计算函数

小乐乐计算函数

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;
}

全部评论

相关推荐

12-13 14:51
已编辑
井冈山大学 算法工程师
龙虾x:算法比你强的没有你美,比你美的…..算了已经没有比你美的了
工作两年想退休了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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