HDU 2268

http://acm.hdu.edu.cn/showproblem.php?pid=2268

小学四年级应用题,让我找回了儿时的快乐。。。

#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std ;
int main()
{
    int a,b,c ;
    while(~scanf("%d%d%d",&a,&b,&c))
    {
        if(b<=a)
        {
            printf("%.3lf
",c*1.0/a) ;
            continue ;
        }
        double x=c*1.0*(b+a)/(3*a+b) ;
        printf("%.3lf
",x/b+(c-x)/a) ;
    }
    return 0 ;
}
View Code
原文地址:https://www.cnblogs.com/xiaohongmao/p/3463417.html