JAVA用IF-ELSE循环实现考试成绩及其对应的评价,与输入两个数字的大小比较,并进行互换------JAVA

        

        Scanner in = new Scanner(System.in);

        System.out.println("输入学生成绩");
        int score = in.nextInt();
        if(score <= 100 && score >= 90)
        {
            System.out.println("excellent");
        }
        else if(score <= 89 && score >= 80)
        {
            System.out.println("great");
        }
        else if(score <= 79 && score >= 70)
        {
            System.out.println("good");
        }
        else
        {
            System.out.println("just passed");
        }

//两个数字的大小比较,并进行互换

        int small = in.nextInt();
        int big = in.nextInt();
        if(big < small)
        {
            int temp = big;
            big = small;
            small = temp;
            System.out.println(small+"+"+big);
        }
        else
        {
            System.out.println(small+"+"+big);
        }

       

        Scanner in = new Scanner(System.in);

        System.out.println("输入学生成绩");
        int score = in.nextInt();
        if(score <= 100 && score >= 90)
        {
            System.out.println("excellent");
        }
        else if(score <= 89 && score >= 80)
        {
            System.out.println("great");
        }
        else if(score <= 79 && score >= 70)
        {
            System.out.println("good");
        }
        else
        {
            System.out.println("just passed");
        }

//两个数字的大小比较,并进行互换

        int small = in.nextInt();
        int big = in.nextInt();
        if(big < small)
        {
            int temp = big;
            big = small;
            small = temp;
            System.out.println(small+"+"+big);
        }
        else
        {
            System.out.println(small+"+"+big);
        }

你可能感兴趣的:(JAVA,java,数据结构,maven,java-ee,mybatis,tomcat,spring,boot)