Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.ConditionalStatements;
- 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);
- }
- if (a > b && a > c && c > b) {
- System.out.printf(a + " " + c + " " + b);
- }
- if (b > a && b > c && a > c) {
- System.out.printf(b + " " + a + " " + c);
- }
- if (b > a && b > c && c > a) {
- System.out.printf(b + " " + c + " " + a);
- }
- if (c > a && c > b && b > a) {
- System.out.printf(c + " " + b + " " + a);
- }
- if (c > a && c > b && a > b) {
- System.out.printf(c + " " + a + " " + b);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment