import java.util.Scanner; class Demo1 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("输入三个数,请输入第一个数"); int a =sc.nextInt(); System.out.println("请输入第二个数"); int b =sc.nextInt(); System.out.println("请输入第三个数"); int c =sc.nextInt(); if (a > b && b > c) { System.out.println("从大到小依次为:"+ c +","+ b +","+ a); }else if (a > c && c > b ) { System.out.println("从大到小依次为:"+ b +","+ c +","+ a); }else if (b > c && c > a) { System.out.println("从大到小依次为:"+ a +","+ c +","+ b); }else if (b > a && a > c) { System.out.println("从大到小依次为:"+ c +","+ a +","+ b); }else if (c > a && a > b) { System.out.println("从大到小依次为:"+ b +","+ a +","+ c); }else if (c > b && b > a) { System.out.println("从大到小依次为:"+ a +","+ b +","+ c); } } } |