#37145: python 紀錄


BensonDC (python戰士)

學校 : 不指定學校
編號 : 240921
來源 : [163.32.78.214]
最後登入時間 :
2024-11-06 14:27:58
e969. 大吃大喝 (Big eater) -- TOI練習賽201903新手組第3題 | From: [36.238.105.93] | 發表日期 : 2023-08-23 00:55

N,M,K=map(int,input().split())
t=0
m=0
while True:
    if K==0:
        if N<32 and t==0:
            print("Wayne can't eat and drink.")
            break
        N-=32
        if N==0:
            print(f"{m}: Wayne eats an Apple pie, and now he doesn't have money.")
            break
        elif N==1:
            print(f"{m}: Wayne eats an Apple pie, and now he has 1 dollar.")
            break
        print(f"{m}: Wayne eats an Apple pie, and now he has {N} dollars.")
        K=1
        m+=M
        if N<55:
            break
    if K==1:
        if N<55 and t==0:
            print("Wayne can't eat and drink.")
            break
        N-=55
        if N==0:
            print(f"{m}: Wayne drinks a Corn soup, and now he doesn't have money.")
            break
        elif N==1:
            print(f"{m}: Wayne drinks a Corn soup, and now he has 1 dollar.")
            break
        print(f"{m}: Wayne drinks a Corn soup, and now he has {N} dollars.")
        K=0
        m+=M
        if N<32:
            break

 
ZeroJudge Forum