import java.io.File; import java.util.Scanner; import java.io.PrintWriter; class Demo { public static void main(String[] args) throws Exception { Scanner scn=new Scanner(System.in); System.out.println("输入选择:1,2,3"); int swi=scn.nextInt(); switch (swi){ case 1: System.out.println("Selected 1"); break; case 2: System.out.println("Selected 2"); break; case 3: System.out.println("Selected 3"); break; default: System.out.println("Not selected"); } } }
原文地址:https://www.cnblogs.com/jodie2019/p/12273392.html
时间: 2024-10-05 23:22:15