HOJ 1271 Biker's Trip Odometer

http://acm.hit.edu.cn/hoj/problem/view?id=1271

#include 
#include 

const double pi = acos(-1);

int main()
{
    double d, r, s, distance, speed, count;

    count = 1;
    while (scanf("%lf %lf %lf", &d, &r, &s) != EOF)
    {
        if (r == 0)
            break;
        distance = pi * d * r/63360;
        speed = 3600 * distance / s;
        printf("Trip #%.0lf: %.2lf %.2lf\n", count, distance, speed);
        count++;
    }

    return 0;
}


 

你可能感兴趣的:(HOJ)