public class SwitchTest {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
System.out.println("请输入:");
int i=s.nextInt();
switch (i) {
case 1:
System.out.println("one");
break;
case 2:
System.out.println("two");
break;
case 3:
System.out.println("three");
break;
case 4:
System.out.println("four");
break;
default:
System.out.println("输入错误!");
break;
}
}
}
是啊。。
这个...
有点基础的都会啊?