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: Accepted)

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
	/*??¶?´???????????????????*/
	public static int judge(ArrayList<Integer> parse,int len){
		int result=0;
		for(int j=0;j<len;j++){
			if(parse.get(j)<1||parse.get(j)>10000){
				result = 1;
			}
			else{
				result = 0;
			}
		}
		return result;
	}

	public static void main(String[] args) throws IOException{
		String str;

		/* ???????????£?¨? */
		ArrayList<String> st = new ArrayList<String>();
		ArrayList<Integer> parse = new ArrayList<Integer>(); // int??????

		/*?????????????????\???*/
		Scanner scan = new Scanner(System.in);
		for (int i = 0; i < 3; i++) {
			st.add(scan.next());
		}

		int len = st.size(); // ?????????????´???°

		/* String???int????????¨int????????????????´? */
		for (int p = 0; p < len; p++) {
			str = st.get(p);
			int temp = Integer.parseInt(str);
			parse.add(temp);
		}


		/*????????¨????????????*/
		if(judge(parse,len) == 0){
        Collections.sort(parse); //???????????????
		System.out.println(parse.get(0)+(" ")+parse.get(1)+(" ")+parse.get(2));
		}
		else if(judge(parse,len) == 1){
			System.out.println("??\???????????????1~10000??§???.???????????????.");
		}
	}
}