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. Django - 自定义请求头

    收藏一下以后学习 博客搬运地址 Django接收自定义http header(转)

  2. 4.28 QBXT模拟赛

    NOIP2016提高组模拟赛 ——By wangyurzee7 中文题目名称 迷妹 膜拜 换数游戏 英文题目与子目录名 fans mod game 可执行文件名 fans mod game 输入文件名 ...

  3. Appium + python -yaml配置文件

    在线安装:pip install yaml import yamlimport os # 获取当前脚本所在文件夹路径curpath = os.path.dirname(os.path.realpath ...

  4. redis-数据结构以及使用场景分析

    目录 redis 常见数据结构以及使用场景分析 key String Hash List Set Sorted Set Bitmap和HyperLogLog Pub/Sub redis 常见数据结构以 ...

  5. easyui -tree的详细讲解

    代码的具体实现 @{    ViewBag.Title = "人员查找";    ViewBag.LeftWidth = "200px";    ViewBag ...

  6. Centos7 时间不正确修复

    查看系统支持的时区列表 timedatectl list-timezones 使用 date -R 查看时区是否正确 date -R 修改时区 timedatectl set-timezone Asi ...

  7. JavaScript 计时器

    在JavaScript中,我们可以在设定的时间间隔之后来执行代码,而不是在函数被调用后立即执行.计时器类型:一次性计时器:仅在指定的延迟时间之后触发一次.间隔性触发计时器:每隔一定的时间间隔就触发一次 ...

  8. JSP所需要掌握的部分

    JSP基本语法 指令 <%@ 指令%> JSP指令是JSP的引擎 主要的两种指令是page和include(taglib) <%@ page import="java.ut ...

  9. 347 Top K Frequent Elements 前K个高频元素

    给定一个非空的整数数组,返回其中出现频率前 k 高的元素.例如,给定数组 [1,1,1,2,2,3] , 和 k = 2,返回 [1,2].注意:    你可以假设给定的 k 总是合理的,1 ≤ k ...

  10. linux设置库文件加载包含路径

    第一种方式vim /etc/ld.so.conf 将要包含的路径添加到此文件中退出重新登录使配置生效或者执行命令source /etc/ld.so.conf 另一种方式利用LIBRARY_PATH和L ...