문제
연세대학교의 영문명은 YONSEI, 슬로건은 Leading the Way to the Future이다.
이를 출력하는 프로그램을 작성해보도록 하자.
입력
첫째 줄에 N이 주어진다. (N = 0 또는 1)
출력
N = 0일 경우: 연세대학교의 영문명을 출력한다.
N = 1일 경우: 연세대학교의 슬로건을 출력한다.
대소문자 구별에 주의하도록 하자.
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class baek_15680 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
// 숫자와 출력 문자열 맵핑
Map<Integer, String> map = new HashMap<>();
map.put(0, "YONSEI");
map.put(1, "Leading the Way to the Future");
// 결과 출력
System.out.println(map.get(a));
}
}