Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SortThree {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int a = input.nextInt();
- int b = input.nextInt();
- int c = input.nextInt();
- if (a >= -1000 && a <= 1000 && b >= -1000 && b <= 1000 && c >= -1000 && c <= 1000) {
- if (a >= b && a >= c && b >= c) {
- System.out.printf(a + " " + b + " " + c);
- } else if (a >= b && a >= c && c >= b) {
- System.out.printf(a + " " + c + " " + b);
- } else if (b >= a && b >= c && a >= c) {
- System.out.printf(b + " " + a + " " + c);
- } else if (b >= a && b >= c && c >= a) {
- System.out.printf(b + " " + c + " " + a);
- } else if (c >= a && c >= b && b >= a) {
- System.out.printf(c + " " + b + " " + a);
- } else if (c >= a && c >= b && a >= b) {
- System.out.printf(c + " " + a + " " + b);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment