BOJ - 15351 - 인생 점수

Updated:

alphabet = [
    ' ', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
    'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
]
def solution():
    T = int(input())
    for _ in range(T):
        word = str(input())
        score = 0
        for i in range(len(word)):
            score += alphabet.index(word[i])
        if score == 100: print("PERFECT LIFE")
        else: print(score)
solution()

https://www.acmicpc.net/problem/15351

Categories:

Updated:

Leave a comment