-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2d1.py
50 lines (50 loc) · 1.28 KB
/
2d1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
'''เบื่อแล้วขนมตู้ อยากเป็นชู้กับเธอ'''
def sn_1(rest):
'''snack 1'''
if rest % 3 == 0:
return 10
elif rest % 3 == 1:
return 15
elif rest % 3 == 2:
return 20
def sn_2(rest):
'''snack 2'''
if rest % 3 == 0:
return 12
elif rest % 3 == 1:
return 15
elif rest % 3 == 2:
return 18
def sn_3(rest):
'''snack 3'''
if rest % 3 == 0:
return 5
elif rest % 3 == 1:
return 7
elif rest % 3 == 2:
return 9
def main():
'''store'''
budget = int(input())
water = int(input())
num_1 = int(input())
num_2 = int(input())
num_3 = int(input())
rest = budget - water
cost_1 = num_1 * sn_1(rest)
rest -= cost_1
cost_2 = num_2 * sn_2(rest)
rest -= cost_2
cost_3 = num_3 * sn_3(rest)
rest -= cost_3
if rest < 0:
print("Now you have %d left." %budget)
print("You don't have enough money!")
elif rest >= 0:
print("Now you have %d left." %rest)
print("Here's your order!")
print("Water: %d baht" %water)
print("Snack number 1: %d baht" %cost_1)
print("Snack number 2: %d baht" %cost_2)
print("Snack number 3: %d baht" %cost_3)
main()