UVA - 10491 Cows and Cars

题意:这里有讲的很完整的点击打开链接
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

int main(){
    int cow,car,show,temp;
    while (scanf("%d%d%d",&cow,&car,&show) != EOF){
        int temp = cow + car - 1;
        printf("%.5f\n",(double)temp*car/((temp+1)*(temp-show)));
    }
    return 0;
}


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