Problem:
Sorting Three Numbers

Write a program which reads three integers, and prints them in ascending order.

Input

Three integers separated by a single space are given in a line.

Output

Print the given integers in ascending order in a line. Put a single space between two integers.

Constraints

1 ≤ the three integers ≤ 10000

Sample Input 1

3 8 1

Sample Output 1

1 3 8

Solution in JAVA (judge verdict: Wrong Answer)

import java.util.*;
public class Main{
public static void main(String args[]){
Scanner scanner = new Scanner(System.in);
String input = scanner.nextLine();
String[] input1=input.split(" ");
int[] in={0,0,0};
for(int i=0;i<input1.length;i++){
in[i] = Integer.parseInt(input1[i]);
}
int store;
while(in[0]<in[1] &&in[1]<in[2]){
if(in[0]>in[1]){
store=in[0];
in[0]=in[1];
in[1]=store;
}
if(in[1]>in[2]){
store=in[1];
in[1]=in[2];
in[2]=store;
}
}
System.out.print(in[0]+" "+in[1]+" "+in[2]);
}
}