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\n",c*1.0/a) ;

            continue ;

        }

        double x=c*1.0*(b+a)/(3*a+b) ;

        printf("%.3lf\n",x/b+(c-x)/a) ;

    }

    return 0 ;

}
View Code

 

你可能感兴趣的:(HDU)