import java.util.Scanner;
public class hw_15 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
int z = sc.nextInt();
//Let x = The smallest integer of the three integers
if (x > y) {
int temp = y;
y = x;
x = temp;
}
if (x > z) {
int temp = z;
z = x;
x = temp;
}
//find the second smallest integer y, and the biggest integer z
if (y > z) {
int temp = z;
z = y;
y = temp;
}
System.out.println(x + " " + y + " "+ z);
}
}
求所输入三个数的由小到大排列 java
最新推荐文章于 2024-01-17 23:40:41 发布