Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. checkinh = int(input("請您輸入停車開始時"))
  2. checkinm = int(input("請輸入您停車開始分"))
  3. checkouth = int(input("請輸入您停車結束時"))
  4. checkoutm = int(input("請輸入您停車結束分"))
  5. parktime = int(((checkouth - checkinh) * 60) + (checkoutm - checkinm))//30)
  6. if parktime <= 120:
  7. print("停車費為 :" , (parktime * 30))
  8. elif 120 < parktime <= 240:
  9. print("停車費為 :" , (120 + ((parktime - 4) * 40)))
  10. else :
  11. print("停車費為 :" , (120 + 160 + ((parktime - 8) * 60)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement