#34986: python AC


1554101-0@g.puiching.edu.mo (P6A29_1300題了)

學校 : 澳門培正中學
編號 : 216811
來源 : [60.246.150.90]
最後登入時間 :
2024-10-10 18:56:38
d086. 態度之重要的證明 -- 成功電研20th~21st C++ ~最後的競賽~ | From: [27.109.151.69] | 發表日期 : 2023-05-01 11:11

a = {"a":1,"b":2,"c":3,"d":4,"e":5,"f":6,"g":7,"h":8,"i":9,"j":10,"k":11,"l":12,"m":13,"n":14,"o":15,"p":16,"q":17,"r":18,"s":19,"t":20,"u":21,"v":22,"w":23,"x":24,"y":25,"z":26}
while True:
    count = 0
    x = True
    word = input().lower()
    if word == "0":
        break
    for letter in word:
        if letter not in a:
            print("Fail")
            x = False
            break
        count+=a[letter]
    if x == True:
        print(count)

 
ZeroJudge Forum