공부/SWEA

[SWEA-4406] 모음이 보이지 않는 사람 - Java

빈v 2024. 3. 24. 22:00
728x90

 

https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=3&contestProbId=AWNcD_66pUEDFAV8&categoryId=AWNcD_66pUEDFAV8&categoryType=CODE&problemTitle=&orderBy=PASS_RATE&selectCodeLang=JAVA&select-1=3&pageSize=10&pageIndex=1

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

 

문제: SWEA 4406번 모음이 보이지 않는 사람 자바 풀이

난이도: D3

 

코드

import java.util.Scanner;

class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
		int T;
		T=sc.nextInt();
        sc.nextLine();
        for(int test_case = 1; test_case <= T; test_case++)
		{
            String str = sc.nextLine();
            String []arr = {"a","e","i","o","u"};
            for(int i=0;i<arr.length;i++){
                str=str.replace(arr[i], "");
            }
            System.out.println("#"+test_case+" "+str);
        }
    }
}

 

728x90
반응형