꾸준히 합시다

백준 파이썬 16360번: Go Latin 본문

코딩 테스트 문제 풀이

백준 파이썬 16360번: Go Latin

tturbo0824 2021. 6. 15. 10:41

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

 

16360번: Go Latin

Your program is to read from standard input. The input starts with a line containing an integer, n (1 ≤ n ≤ 20), where n is the number of English words. In the following n lines, each line contains an English word. Words use only lowercase alphabet let

www.acmicpc.net

문제 유형: 문자열

 

 

# Solution 1

for _ in range(int(input())):
    word = input()
    
    if word[-1] == "a" or word[-1] == "o" or word[-1] == "u":
        print(word + "s")
    elif word[-1] == "i" or word[-1] == "y":
        print(word[0:-1] + "ios")
    elif word[-1] == "n":
        print(word[0:-1] + "anes")
    elif word[-2:len(word)] == "ne":
        print(word[0:-2] + "anes")
    elif word[-1] == "l" or word[-1] == "r" or word[-1] == "v":
        print(word + "es")
    elif word[-1] == "t" or word[-1] == "w" :
        print(word + "as")
    else:
        print(word + "us")

주어진 영단어를 정해진 규칙에 따라 라틴어와 유사한(pseudo-Latin) 단어로 변환하는 단순 구현 문제이다.

Comments