#46430: Python 解法 歡迎參考


edwardchiu0502@gmail.com (暮影行者)

School : No School
ID : 254548
IP address : [60.249.12.45]
Last Login :
2025-05-01 09:35:25
f147. 1. 點餐系統 (Ordering System) -- 2020年6月TOI練習賽新手組 | From: [220.132.40.176] | Post Date : 2025-06-22 00:01

set = [["Medium Wac","WChicken Nugget","Geez Burger","ButtMilk Crispy Chicken","Plastic Toy"],
[4, 8, 7, 6, 3]]
single = [["German Fries","Durian Slices","WcFurry","Chocolate Sunday"],
[2, 3, 5, 7]]
total = 0

try:
while True:
n = int(input())
if n == 0:
print(f"Total: {total}")
break
elif n == 1:
k = int(input())
print(f"{set[0][k-1]} {set[1][k-1]}")
total += set[1][k-1]
elif n == 2:
k = int(input())
print(f"{single[0][k - 1]} {single[1][k - 1]}")
total += single[1][k - 1]

except EOFError:
pass
 
ZeroJudge Forum