HOJ 1271 Biker's Trip Odometer

来源:互联网 发布:淘宝q币充值代理 编辑:程序博客网 时间:2024/06/01 08:36

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

#include <stdio.h>#include <math.h>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;}


 

原创粉丝点击