Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- checkinh = int(input("請您輸入停車開始時"))
- checkinm = int(input("請輸入您停車開始分"))
- checkouth = int(input("請輸入您停車結束時"))
- checkoutm = int(input("請輸入您停車結束分"))
- parktime = int(((checkouth - checkinh) * 60) + (checkoutm - checkinm))//30)
- if parktime <= 120:
- print("停車費為 :" , (parktime * 30))
- elif 120 < parktime <= 240:
- print("停車費為 :" , (120 + ((parktime - 4) * 40)))
- else :
- print("停車費為 :" , (120 + 160 + ((parktime - 8) * 60)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement