All conditions are correct but server doesn't except solution. Can someone please help me and tell me where am I mistaking? Try to run my code and I am sure that you will get correct solution.
package com.codegym.task.task04.task0420;
/*
Sorting three numbers
*/
import java.io.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
Scanner scan1 = new Scanner(System.in);
int a = scan1.nextInt();
Scanner scan2 = new Scanner(System.in);
int b = scan2.nextInt();
Scanner scan3 = new Scanner(System.in);
int c = scan3.nextInt();
if (a > b && b >= c) {
if (c >= 0 && b >= c)
System.out.println(a + " " + b + " " + c);
else
System.out.println(a + " " + c + " " + b);
}
else if (b > a && a >= c) {
if (c >= 0 && a >= c)
System.out.println(b + " " + a + " " + c);
else
System.out.println(b + " " + c + " " + a);
}
else if (c > a && a >= b) {
if (b >= 0 && a >= b)
System.out.println(c + " " + a + " " + b);
else
System.out.println(c + " " + b + " " + a);
}
scan1.close();
scan2.close();
scan3.close();
}
}