[JAVA] SWEA 5549- 홀수일까 짝수일까

hyng·2022년 3월 7일
0

SWEA

목록 보기
49/78

import java.util.*;
class Solution
{
	public static void main(String args[]) throws Exception
	{
		Scanner sc = new Scanner(System.in);
        StringBuffer sb = new StringBuffer();


        int T = Integer.parseInt(sc.nextLine());
        for (int tc = 1; tc <= T; tc++) {
            sb.append("#").append(tc).append(" ");

            String input = sc.nextLine();
            if((input.charAt(input.length()-1) - '0') % 2 == 0){
                sb.append("Even");
            }else{
                sb.append("Odd");
            }
            sb.append("\n");
        }
        System.out.println(sb);
    }
}
profile
공부하고 알게 된 내용을 기록하는 블로그

0개의 댓글