import java.util.Scanner;
class Test14 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("请输入第一个数:");
int a = sc.nextInt();
System.out.print("请输入第二个数:");
int b = sc.nextInt();
System.out.print("请输入第仨数:");
int c = sc.nextInt();
int max = (a>b)?((a>c)?a:c):((b>c)?b:c);
int min = (a<b)?((a<c)?a:c):((b<c)?b:c);
int z = a + b + c - max - min;
System.out.println("按照从小到大排序后的顺序为:"+min+","+z+","+max);
}
} |
|