지나가던 개발자
[Python] 백준 4659번(비밀번호 발음하기) 문제 풀이 본문
while True:
pw = input()
if pw == "end":
break
if "a" not in pw and "i" not in pw and "u" not in pw and "e" not in pw and "o" not in pw:
print("<"+pw+"> is not acceptable.")
continue
if "aa" in pw or "bb" in pw or "cc" in pw or "dd" in pw or "eee" in pw or "ff" in pw or "gg" in pw or "hh" in pw or "ii" in pw or "jj" in pw or "kk" in pw or "ll" in pw or "mm" in pw or "nn" in pw or "ooo" in pw or "pp" in pw or "qq" in pw or "rr" in pw or "ss" in pw or "tt" in pw or "uu" in pw or "vv" in pw or "ww" in pw or "xx" in pw or "yy" in pw or "zz" in pw:
print("<"+pw+"> is not acceptable.")
continue
moum = ['a','e','i','o','u']
ima = ''
inARow = 0
printed = False
for i in pw: #rqeuya
if i in moum:
if ima == '':
inARow += 1
ima = "moum"
elif ima == "moum":
inARow += 1
else:
ima = "moum"
inARow = 1
else:
if ima == '':
inARow += 1
ima = "jaum"
elif ima == "jaum":
inARow += 1
else:
ima = "jaum"
inARow = 1
if inARow >= 3:
print("<"+pw+"> is not acceptable.")
printed = True
break
if not printed:
print("<"+pw+"> is acceptable.")
'PS > Python' 카테고리의 다른 글
[Python] 백준 25757번(임스와 함께하는 미니게임) 문제 풀이 (1) | 2022.11.15 |
---|---|
[Python] 백준 5635번(생일) 문제 풀이 (0) | 2022.11.15 |
[Python] 백준 10821번(정수의 개수) 문제 풀이 (0) | 2022.11.14 |
[Python] 백준 12605번(단어순서 뒤집기) 문제 풀이 (0) | 2022.11.14 |
[Python] 백준 10384번(팬그램) 문제 풀이 (0) | 2022.11.14 |
Comments