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

小乐乐计算函数

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

#include<stdio.h>
int max3(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= 0;
    int b = 0;
    int c= 0;
    double sum = 0.0;
    scanf("%d%d%d",&a,&b,&c);
    int ret1 = max3(a+b,b,c);
    int ret2 = max3(a,b+c,c);
    int ret3 = max3(a,b,b+c);
    sum = ret1*1.0/(ret2+ret3);
    printf("%.2lf",sum);
    return 0;
}
全部评论

相关推荐

05-29 22:11
门头沟学院 Java
Elastic90:抛开学历造假不谈,这公司的招聘需求也挺怪的,Java开发还要求你有图文识别、移动端开发和c++的经验,有点逆天了。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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