python-algorithm

백준 9226 도깨비말

무적김두칠 2021. 12. 3. 09:26

1
2
3
4
5
6
7
8
9
10
11
12
13
14
from collections import deque
vowel=['a','e','i','o','u']
while 1:
    s=input()
    if s=='#' : break
    tmp=deque()
    for i in s: tmp.append(i)
    if vowel not in tmp:
        print(s+"ay")
    else:
        while tmp[0not in vowel :tmp.rotate(-1)
        for i in tmp:
            print(i,end='')
        print("ay")
cs
반응형