/**
* 需求:基本练习,输入1-7来查询,weekDay;
* 思路:if-else if-else 语句;
*
* 步骤:略
*/
import java.util.Scanner;
public class Demo_1{
public static void main(String[] arge) {
Scanner input = new Scanner(System.in);
System.out.println("please enter two number: ");
int weekDay = input.nextInt();//输入一个数字
if(weekDay==1){
System.out.println("Today is Monday ");
}
if(weekDay==2){
System.out.println("Today is Tuesday");
}
if(weekDay==3){
System.out.println("Today is Wednesday");
}
if(weekDay==4){
System.out.println("Today is Thursday");
}
else if(weekDay==5){
System.out.println("Today is Friday");
}
else if(weekDay==6){
System.out.println("Today is Saturday");
}
else if(weekDay==7){
System.out.println("Today is Sunday");
}
else
{
System.out.println("Your enter error");
}
}
}
This moment will nap, you will have a dream; but this moment study, you will interpret a dream.