Search

switch

import java.util.Scanner; public class Ex05_Switch { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("์ฑ„๋„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”"); int channel = sc.nextInt(); switch (channel) { case 11: System.out.println("MBC - ๋ฌดํ•œ๋„์ „"); break; case 7: System.out.println("KBS - ๋‰ด์Šค"); break; case 33: System.out.println("CGV - ๋ฐ˜์ง€์˜์ œ์™•"); break; case 100: System.out.println("๋„ทํ”Œ๋ฆญ์Šค - ์Šค์œ„ํŠธํ™ˆ3"); break; default: System.out.println("์š”์ฒญํ•˜์‹  ์ฑ„๋„์ด ์—†์Šต๋‹ˆ๋‹ค."); break; } sc.close(); } }
Java
๋ณต์‚ฌ