标签:inpu ati bsp system.in switch ann exti static ext1
选择结构还有: switch结构
import java.util.Scanner;
public class Text1{
public static void main(String[]args){
Scanner input=new Scanner(System.in);
System.out.println("请输入星期几");
int week=input.nextInt();
switch(week){
case 1:
System.out.println("英语");
break;
case 2:
System.out.println("数学");
break;
case 3:
System.out.println("语文");
break;
case 4:
System.out.println("历史"):
break;
case 5:
System.out.println("政治");
break;
default:
System.out.println("休息");
break;
}
}
}
标签:inpu ati bsp system.in switch ann exti static ext1
原文地址:http://www.cnblogs.com/erci-520/p/6685439.html