UVA 10491(p326)----Cows and Cars

#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
    double a,b,c;
    while(scanf("%lf%lf%lf",&a,&b,&c)==3)
    {
        double ans1=(a/(a+b))*(b/(a+b-1-c));
        //cout<<ans1<<endl;
        double ans2=(b/(a+b))*((b-1)/(a+b-1-c));
       // cout<<ans2<<endl;
        printf("%.5lf\n",ans1+ans2);
    }
    return 0;
}

你可能感兴趣的:(UVA 10491(p326)----Cows and Cars)