mstoyanova

Untitled

Jan 25th, 2021
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.10 KB | None | 0 0
  1. package com.ConditionalStatements;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class SortThree {
  6.     public static void main(String[] args) {
  7.         Scanner input = new Scanner(System.in);
  8.  
  9.  
  10.         int a = input.nextInt();
  11.         int b = input.nextInt();
  12.        int c = input.nextInt();
  13.  
  14.         if (a >= -1000 && a <= 1000 && b >= -1000 && b <= 1000 && c >= -1000 && c <= 1000) {
  15.  
  16.  
  17.             if (a > b && a > c && b > c) {
  18.                 System.out.printf(a + " " + b + " " + c);
  19.             }
  20.             if (a > b && a > c && c > b) {
  21.                 System.out.printf(a + " " + c + " " + b);
  22.             }
  23.             if (b > a && b > c && a > c) {
  24.                 System.out.printf(b + " " + a + " " + c);
  25.             }
  26.             if (b > a && b > c && c > a) {
  27.                 System.out.printf(b + " " + c + " " + a);
  28.             }
  29.             if (c > a && c > b && b > a) {
  30.                 System.out.printf(c + " " + b + " " + a);
  31.             }
  32.             if (c > a && c > b && a > b) {
  33.                 System.out.printf(c + " " + a + " " + b);
  34.             }
  35.         }
  36.     }
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment