package com.lovcoding.day04;

import java.util.Scanner;

public class Test01IfQianTaoEx {
    public static void main(String[] args) {
        int n1 = 3;
        int n2 = 2;
        int n3 = 1;

        System.out.println("n1="+n1+" n2="+n2+" n3="+n3);

        // n1 > n2  交换 小的放前面
        if (n1 > n2){
            int temp = n1;
            n1 = n2;
            n2 = temp;
        }
        System.out.println("n1="+n1+" n2="+n2+" n3="+n3);

        if (n2 > n3){
            int temp = n2;
            n2 = n3;
            n3 = temp;
        }
        System.out.println("n1="+n1+" n2="+n2+" n3="+n3);

        if (n1 > n2){
            int temp = n1;
            n1 = n2;
            n2 = temp;
        }
        System.out.println("n1="+n1+" n2="+n2+" n3="+n3);

    }
    public static void main_b(String[] args) {
        //提示
        //三个数排序  6中情况
        /*
            数字
            n1 n2 n3

            n1 < n2 < n3
            n1 < n3 < n2

            n2 < n1 < n3
            n2 < n3 < n1

            n3 < n2 < n1
            n3 < n1 < n2

            输出语句 6个
         */
        Scanner s = new Scanner(System.in);

        System.out.println("请输入");
        int n1 = s.nextInt();
        int n2 = s.nextInt();
        int n3 = s.nextInt();

        if (n1<n2){
            if (n2<n3){
                System.out.println(321);
            }else {
                if (n1 < n3 ){
                    System.out.println(132);
                }else {
                    System.out.println(132);
                }
            }
        }
    }

    public static void main_a(String[] args) {
        //提示
        //三个数排序  6中情况
        /*
            数字
            n1 n2 n3

            n1 < n2 < n3
            n1 < n3 < n2

            n2 < n1 < n3
            n2 < n3 < n1

            n3 < n2 < n1
            n3 < n1 < n2

            输出语句 6个
         */
        Scanner s = new Scanner(System.in);

        System.out.println("请输入");
        int n1 = s.nextInt();
        int n2 = s.nextInt();
        int n3 = s.nextInt();

        if (n1 < n2 && n2 < n3){
            System.out.println(n1 +"<"+ n2 +"<"+ n3);
        }else if (n1 < n3 && n3< n2){
            System.out.println(n1 +"<"+ n3 +"<"+ n2);
        }else if (n2 < n1 && n1 < n3){
            System.out.println(n2 +"<"+ n1 +"<"+ n3);
        }else if (n2 < n3 && n3< n1){
            System.out.println(n2 +"<"+ n3 +"<"+ n1);
        }else if (n3 < n2 && n2< n1){
            System.out.println(n3 +"<"+ n2 +"<"+ n1);
        }else if (n3 < n1 && n1< n2){
            System.out.println(n3 +"<"+ n1 +"<"+ n2);
        }
    }
}
