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.util.Scanner;

/**
 * コンソールテスト用Main クラス
 *
 */
public class Main {

	/* コンストラクタ */
	Main() {
	//何もしない
	}

	/**
	 * 提出
	 *
	 */

	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = 0;
		int b = 0;
		int c = 0;
		int tmpB = 0;
		int tmpC = 0;

		/* ３つの整数を読み込み、それらを値が小さい順に並べて出力するプログラムを作成する */
		a = scanner.nextInt();
		b = scanner.nextInt();
		c = scanner.nextInt();

		if (a > b) {
			tmpB = b;
			b = a;
			a = tmpB;
		}
		if (b > c) {
			tmpC = c;
			c = b;
			b = tmpC;
		}
		if (a > b) {
			tmpB = b;
			b = a;
			a = tmpB;
		}

		System.out.println(a + " " + b + " " + c );

	}
}