package 第四次作业;
public class X{
    public static void main(String[] args){
        //第六题判断语句
        int weekDay=3;//判断星期
        if(weekDay==1){
            System.out.println("今天是星期一");
        }
        else if(weekDay==2){
            System.out.println("今天是星期二");
        }
        else if(weekDay==3){
            System.out.println("今天是星期三");
        }
        else if(weekDay==4){
            System.out.println("今天是星期四");
        }
        else if(weekDay==5){
            System.out.println("今天是星期五");
        }
        else if(weekDay==6){
            System.out.println("今天是星期六");
        }
        else if(weekDay==7){
            System.out.println("今天是星期日");
        }
        else{
            System.out.println("没有这一天");
        }
        int month=8;//判断季节
        if(month==3||month==4||month==5){
            System.out.println("现在是春天");
        }
        else if(month==6||month==7||month==8){
            System.out.println("现在是夏天");
        }
        else if(month==9||month==10||month==11){
            System.out.println("现在是秋天");
        }
        else if(month==12||month==1||month==2){
            System.out.println("现在是冬天");
        }
        else{
            System.out.println("没有这个季节");
        }
        //第七题使用分支语句
        int c=84,h=3;
            char option='+';
               switch (option)
            {
            case '+':
                    System.out.println("c+h="+(c+h));
                    break;
            case '-':
                    System.out.println("c-h="+(c-h));
                    break;
            case '*':
                    System.out.println("c*h="+(c*h));
                    break;
            case '/':
                    System.out.println("c/h="+(c/h));
                    break;
            case '%':
                    System.out.println("c%h="+(c%h));
                    break;
            default:
                    System.out.println("c%h="+(c%h));
                    break;
            }
        //使用switch判断季节
        int mon=8;
        switch(mon)
        {
        case 3:
        case 4:
        case 5:
            System.out.println("现在是春天");
            break;
        case 6:
        case 7:
        case 8:
            System.out.println("现在是夏天");
            break;
        case 9:
        case 10:
        case 11:
            System.out.println("现在是秋天");
            break;
        case 12:
        case 1:
        case 2:
            System.out.println("现在是冬天");
            break;
        default:
            System.out.println("没有这个季节");
            break;
        }
        //第八题do while和while的区别
        int d=1;
        do{
            System.out.println("d="+d);
            d++;
        }while(d<1);//不管while里面的条件是否成立,do里面的都要运行
        int f=1;
        while(f<1){
            System.out.println("f="+f);
            f++;
        }
        //第九题使用for语句写一个简单的循环语句
        for(int g=1;g<5;g++)
        {
            System.out.println("g="+g);
        }
    }
}