본문 바로가기

프로그래밍 문제/정올

155 : 배열1 - 형성평가6

Java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.util.Scanner;
 
public class Main {
    public static void main (String[] arg) {
        Scanner sc = new Scanner(System.in);
        char[] jungol = {'J''U''N''G''O''L'};
        char ch = sc.nextLine().charAt(0);
 
        switch (ch) {
            case 'J':
                System.out.print("0");
                break;
            case 'U':
                System.out.print("1");
                break;
            case 'N':
                System.out.print("2");
                break;
            case 'G':
                System.out.print("3");
                break;
            case 'O':
                System.out.print("4");
                break;
            case 'L':
                System.out.print("5");
                break;
            default:
                System.out.print("none");
                break;
        }
    }
}
cs