HDU 1038 - Biker's Trip Odometer

算一下路程和速度...

 1 #include <iostream>
 2 #include <cstdio>
 3 using namespace std;
 4 const double p=3.1415927;
 5 double dia,tim,dis,sped;
 6 int rev;
 7 int main()
 8 {
 9     int k=1;
10     while(cin>>dia>>rev>>tim,rev)
11     {
12         dia/=12*5280;
13         dis=dia*p*rev;
14         sped=dis/tim*60*60;
15         printf("Trip #%d: %.2lf %.2lf\n",k++,dis,sped);
16     }
17 }

 

posted @ 2016-04-30 14:36  nicetomeetu  阅读(128)  评论(0编辑  收藏  举报