풀이
money = input()
if (money>=10000):
print u"레스토랑에서 밥먹자 ^^^" # 만원이상 있으면
else:
if(money>=5000):
print u"교직원 식당에서 먹자"
else:
if (money>= 2000):
print u"학생식당에서 먹자"
else:
print u"그냥 굶자"
teaLeft = [3,3,3]
moneyLeft = 1000;
while 1:
print "Type 1 for coffee, 2 for green tea, and 3 for milk Currnetly tea left are %s and money left are %d" %(teaLeft,moneyLeft)
teaKind = input()
print "Put money"
money = input()
if (money<300): print "Dont't play around, I am returning your money"; continue
if (teaKind==1):
if(teaLeft[0]==0):
print "No Coffee"
continue
else:
if (money>300): print "I am giving you change %d" %(money-300)
teaLeft[0]=teaLeft[0]-1;
moneyLeft = moneyLeft+300;
if (teaKind==2):
if(teaLeft[1]==0):
print "No green tea"
continue
else:
if (money>300): print "I am giving you change %d" %(money-300)
teaLeft[1]=teaLeft[1]-1;
moneyLeft = moneyLeft+300;
if (teaKind==3):
if(teaLeft[2]==0):
print "No Milk"
continue
else:
if (money>300): print "I am giving you change %d" %(money-300)
teaLeft[2]=teaLeft[2]-1;
moneyLeft = moneyLeft+300;