Biker's Trip Odometer

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3061    Accepted Submission(s): 2103

Problem Description
Most bicycle speedometers work by using a Hall Effect sensor fastened to the front fork of the bicycle. A magnet is attached to one of the spokes on the front wheel so that it will line up with the Hall Effect switch once per revolution of the wheel. The speedometer monitors the sensor to count wheel revolutions. If the diameter of the wheel is known, the distance traveled can be easily be calculated if you know how many revolutions the wheel has made. In addition, if the time it takes to complete the revolutions is known, the average speed can also be calculated. For this problem, you will write a program to determine the total distance traveled (in miles) and the average speed (in Miles Per Hour) given the wheel diameter, the number of revolutions and the total time of the trip. You can assume that the front wheel never leaves the ground, and there is no slipping or skidding.
 
Input
Input consists of multiple datasets, one per line, of the form:
diameter revolutions time
The diameter is expressed in inches as a floating point value. The revolutions is an integer value. The time is expressed in seconds as a floating point value. Input ends when the value of revolutions is 0 (zero).
 
Output
For each data set, print:
Trip #N: distance MPH
Of course N should be replaced by the data set number, distance by the total distance in miles (accurate to 2 decimal places) and MPH by the speed in miles per hour (accurate to 2 decimal places). Your program should not generate any output for the ending case when revolutions is 0.
Constants
For p use the value: 3.1415927. There are 5280 feet in a mile. There are 12 inches in a foot. There are 60 minutes in an hour. There are 60 seconds in a minute. There are 201.168 meters in a furlong.
 
Sample Input
26 1000 5
27.25 873234 3000
26 0 1000
 
Sample Output
Trip #1: 1.29 928.20
Trip #2: 1179.86 1415.84
 
Source
 
Recommend
 
 #include <stdio.h>
#define pi 3.1415927 int main()
{
double a,c;
int b,k=;
while(scanf("%lf %d %lf",&a,&b,&c),b)
{
printf("Trip #%d: ",k++);
printf("%.2lf %.2lf\n",*pi*a*b///,*pi*a*b*////c);
}
return ;
}

简单题,轻松水过

hdu_1038_Biker's Trip Odometer_201311021643的更多相关文章

  1. Lesson 4 An existing trip

    Text I have just received a letter from my brother,Tim. He is in Australia. He has been there for si ...

  2. dp or 贪心 --- hdu : Road Trip

    Road Trip Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65536KB Total submit users: 29 ...

  3. 【poj1041】 John's trip

    http://poj.org/problem?id=1041 (题目链接) 题意 给出一张无向图,求字典序最小欧拉回路. Solution 这鬼畜的输入是什么心态啊mdzz,这里用vector储存边, ...

  4. 1301. The Trip

    A number of students are members of a club that travels annually to exotic locations. Their destinat ...

  5. 三分 --- POJ 3301 Texas Trip

    Texas Trip Problem's Link:   http://poj.org/problem?id=3301 Mean: 给定n(n <= 30)个点,求出包含这些点的面积最小的正方形 ...

  6. 烟大 Contest1024 - 《挑战编程》第一章:入门 Problem C: The Trip(水题)

    Problem C: The Trip Time Limit: 1 Sec  Memory Limit: 64 MBSubmit: 19  Solved: 3[Submit][Status][Web ...

  7. hdu 3018 Ant Trip 欧拉回路+并查集

    Ant Trip Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem ...

  8. URAL 1004 Sightseeing Trip(最小环)

    Sightseeing Trip Time limit: 0.5 secondMemory limit: 64 MB There is a travel agency in Adelton town ...

  9. Codeforces Round #365 (Div. 2) Mishka and trip

    Mishka and trip 题意: 有n个城市,第i个城市与第i+1个城市相连,他们边的权值等于i的美丽度*i+1的美丽度,有k个首都城市,一个首都城市与每个城市都相连,求所有边的权值. 题解: ...

随机推荐

  1. E20170627-gg

    ring   n. 戒指,指环; 铃声,钟声; 环形物; 拳击场;   vi. 按铃,敲钟; 回响; 成环形; rear   n. 后部,背面,背后; 臀部; (舰队或军队的) 后方,后尾,殿后部队; ...

  2. codeforces——数学

    codeforces 805A     http://codeforces.com/problemset/problem/805/A /* 题意:输入两个整数l,r,让你找一个因子 使得[l,r]里面 ...

  3. [Luogu 2678] noip15 子串

    [Luogu 2678] noip15 子串 题目描述 有两个仅包含小写英文字母的字符串 A 和 B.现在要从字符串 A 中取出 k 个互不重叠的非空子串,然后把这 k 个子串按照其在字符串 A 中出 ...

  4. 2018.10.9 logstash启动慢的问题解决

    问题描述: 线上部署logstash 启动非常缓慢,达到了10分钟 问题解决 忍无可忍 网上资料基本都是熵过低导致jruby启动缓慢的问题,需要安装haveged 参考https://www.jian ...

  5. 移动web——bootstrap媒体对象

    基本模板 1.这些组件都具有在文本内容的左或右侧对齐的图片(就像博客评论或 Twitter 消息等) <div class="media"> <div class ...

  6. C# 字符串的入门

    1."@"表示字符串中的"\"不当成转义符. 2.转义符或者特殊处理的一些字符只是针对于代码中直接写出的字符串中,对于程序运行中读取出来的转义符或者特殊处理的字 ...

  7. Python语言之控制流(if...elif...else,while,for,break,continue)

    1.if...elif...else... number = 23 guess = int(input('Enter an integer : ')) if guess == number: prin ...

  8. 转:selenium自动化脚本错误总结

    https://blog.csdn.net/zxy987872674/article/details/53141118

  9. java设计模式02观察者模式

    观察者模式定义了一种一对多的依赖关系,让多个观察者对象同时监听某一个主题对象.这个主题对象在状态上发生变化时,会通知所有观察者对象,使它们能够自动更新自己. 这里主要讲一下学习内置观察者的记录,在JA ...

  10. Gpupdate命令详解

    刷新本地和基于 Active Directory 的组策略设置,包括安全设置.该命令可以取代 secedit 命令中已经过时的 /refreshpolicy 选项. MS-DOS命令语法 gpupda ...