Algorithm/SWEA

[SWEA - D3] 4406. λͺ¨μŒμ΄ 보이지 μ•ŠλŠ” μ‚¬λžŒ

hello_u 2023. 4. 20. 22:25

 

 

λ‚˜μ˜ μ½”λ“œ

T = int(input())
# μ—¬λŸ¬κ°œμ˜ ν…ŒμŠ€νŠΈ μΌ€μ΄μŠ€κ°€ μ£Όμ–΄μ§€λ―€λ‘œ, 각각을 μ²˜λ¦¬ν•©λ‹ˆλ‹€.
arr = [ "a" , "e" , "i" , "o" , "u" ]
for t in range(1, T + 1):
    s = input()
    result = ''
    for x in s:
        if x not in arr:
            result += x
    print("#"+str(t) , result )

 

 

replace() ν•¨μˆ˜ 생각 μ•ˆλ‚˜μ„œ 

κ·Έλƒ₯ λ¬Έμžμ—΄ λ”ν•˜κΈ°λ‘œ ν’€μ—ˆλ‹€.

 

 

replace() ν•¨μˆ˜

a = input()
for i in ["a","e","i","o","u"]:
    a=a.replace(i,"")