class Iftest
{
public static void main(String[] args)
{
//if语句练习_星期:
int week = 8;
if(week==1)
System.out.println(week+"对应中文是星期一");
else if(week==2)
System.out.println(week+"对应中文是星期二");
else if(week==3)
System.out.println(week+"对应中文是星期三");
else if(week==4)
System.out.println(week+"对应中文是星期四");
else if(week==5)
System.out.println(week+"对应中文是星期五");
else if(week==6)
System.out.println(week+"对应中文是星期六");
else if(week==7)
System.out.println(week+"对应中文是星期日");
else
System.out.println(week+"没有对应的星期值");
/*if语句练习_季节:
春季:3 4 5
夏季:6 7 8
秋季:9 10 11
冬季:12 1 2
*/
int month = 8;
if(month<1 || month>12)
System.out.println(month+"没有对应的季节");
else if(month>=3 && month<=5)
System.out.println(month+"是春季");
else if(month>=6 && month<=8)
System.out.println(month+"是夏季");
else if(month>=9 && month<=11)
System.out.println(month+"是秋季");
else
System.out.println(month+"是冬季");
/*
int month = 12;
if(month==3 || month==4 || month==5)
System.out.println(month+"是春季");
else if(month==6 || month==7 || month==8)
System.out.println(month+"是夏季");
else if(month==9 || month==10 || month==11)
System.out.println(month+"是秋季");
else if(month==12 || month==1 || month==2)
System.out.println(month+"是冬季");
else
System.out.println(month+"没有对应的季节");
*/
}
}