- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsorting.java
More file actions
Latest commit
31 lines (29 loc) · 1.02 KB
/
Copy pathsorting.java
File metadata and controls
31 lines (29 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
importjava.util.Scanner;
publicclasssorting {
publicstaticvoidmain(String[] args) {
intx,y,z;
Scannerinp = newScanner(System.in);
System.out.println("first number:");
x = inp.nextInt();
System.out.println("second number:");
y = inp.nextInt();
System.out.println("third number:");
z = inp.nextInt();
if (x >= y) {
if (y >= z)
System.out.print("In order " + z + " " + y + " " + x);
elseif (z >= x)
System.out.print("In order " + y + " " + x + " " + z);
elseif (x >= z)
System.out.print("In order " + y + " " + z + " " + x);
} else {
if (z >= y)
System.out.print("In order " + x + " " + y + " " + z);
elseif (z >= x)
System.out.print("In order " + x + " " + z + " " + y);
elseif (x >= z)
System.out.print("In order " + z + " " + x + " " + y);
}
inp.close();
}
}