假設一賽跑選手在x分y秒的時間跑完z公里,請撰寫一程式,輸入x、y、z數值,最後顯示此選手每小時的平均英哩速度(1英哩等於1.6公里)。
提示:輸出浮點數到小數點後第一位。
範例輸入:
10
25
3
範例輸出:Speed = 10.8
程式碼:
x = int( input() )
y = int( input() )
z = int( input() )
speed = ( z / ( x * 60 + y ) ) * 3600 / 1.6
print("Speed = {:.1f}".format(speed))
沒有留言:
張貼留言