package com.fqs.test; import java.util.Scanner; public class hello { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.print("请在键盘输入 吃面的编号"); int my_num=sc.nextInt();//键盘接收输入的值放到my_num中 switch (my_num){ case 1: System.out.print("老北京炸酱面"); break; case 2: System.out.print("陕西油泼面"); break; case 3: System.out.print("云南过桥米线"); break; case 4: System.out.print("安徽板面"); break; default: System.out.print("康师傅老谭酸菜面"); break; } } }
标签:case,default,System,break,num,print,out From: https://www.cnblogs.com/haha1988/p/17450177.html