📄 problem 1813.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0047)http://acm.zju.edu.cn/show_problem.php?pid=1813 -->
<HTML><HEAD><TITLE>Problem 1813</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY>
<CENTER><IMG src="Problem 1813.files/logo.gif" align=center></IMG></CENTER>
<HR>
<CENTER><FONT color=blue size=+2>Biker's Trip Odometer</FONT></CENTER>
<HR>
<CENTER><FONT color=green>Time limit:</FONT> 1 Seconds <FONT
color=green>Memory limit: </FONT>32768K </FONT><BR><FONT
color=green>Total Submit:</FONT> 2364 <FONT color=green>Accepted
Submit:</FONT> 1336 </CENTER>
<HR>
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.
<P>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.</P>
<P><BR><B>Input</B></P>
<P>Input consists of multiple datasets, one per line, of the form:</P>
<P>diameter revolutions time</P>
<P>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).</P>
<P><BR><B>Output</B></P>
<P>For each data set, print:</P>
<P>Trip #N: distance MPH</P>
<P>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.</P>
<P>Constants</P>
<P>For p use the value: 3.1415927.<BR>There are 5280 feet in a mile.<BR>There
are 12 inches in a foot.<BR>There are 60 minutes in an hour.<BR>There are 60
seconds in a minute.<BR>There are 201.168 meters in a furlong.</P>
<P><BR><B>Sample Input</B></P>
<P>26 1000 5<BR>27.25 873234 3000<BR>26 0 1000</P>
<P><BR><B>Sample Output</B></P>
<P>Trip #1: 1.29 928.20<BR>Trip #2: 1179.86 1415.84<BR></P>
<HR>
<FONT color=green size=+1>Problem Source: </FONT><I>Greater New York 2003</I>
<HR>
<CENTER><A href="http://acm.zju.edu.cn/submit.php?pid=1813">Submit</A>
<A href="http://acm.zju.edu.cn/list_problem.php?vol=9">Back</A>
<A
href="http://acm.zju.edu.cn/problem_status.php?pid=1813">Status</A> </CENTER>
<HR>
<CENTER>
<TABLE width="100%" border=0>
<TBODY>
<TR>
<TD align=right width="65%"><A href="http://acm.zju.edu.cn/"><FONT
color=red>Zhejiang University Online Judge</FONT></A> <A
href="http://acm.zju.edu.cn/"><FONT color=red>V1.0</FONT></A></TD>
<TD align=right width="35%"><A href="http://www.zzhang.cn/"><FONT
color=#ffffff
size=-3>Book</FONT></A></TD></TR></TBODY></TABLE></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -