本文为博主原创文章,未经博主允许不得转载。欢迎点击屏幕左侧的QQ联系我,或者私信我
版权
package sample;import java.util.Scanner;publicclassDome02{publicstaticvoidmain(String[]args){ Scanner input=newScanner(System.in);for(boolean i=true;i;){ System.out.print("\n"+"请你输入一个数值:");int num=input.nextInt();switch(num){case0: i=false; System.out.println("程序结束");break;case1: System.out.print(num+":今天是MON");break;case2: System.out.print(num+":今天是TUE");break;case3: System.out.print(num+":今天是WED");break;case4: System.out.print(num+":今天是THU");break;case5: System.out.print(num+":今天是FRI");break;case6: System.out.print(num+":今天是SAT");break;case7: System.out.print(num+":今天是SUN");break;default: System.out.print("请重新输入");}}}}