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 C# (judge verdict: Accepted)

using System;

namespace Sorting3Num
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			int[] data = getInputdata (" ");
			int tmp;

			if (data [0] > data [1]) {
				tmp = data [0];
				data [0] = data [1];
				data [1] = tmp;
			}
			if (data [1] > data [2]) {
				tmp = data [1];
				data [1] = data [2];
				data [2] = tmp;
			}
			if (data [0] > data [1]) {
				tmp = data [0];
				data [0] = data [1];
				data [1] = tmp;
			}
	
			Console.WriteLine ("{0} {1} {2}", data[0], data[1], data[2]);
		}

		public static int[] getInputdata (string token)
		{
			string[] data = Console.ReadLine ().Split (token.ToCharArray ());
			int[] idata = new int[data.Length];

			for (int i = 0; i < data.Length; i++) {
				idata [i] = int.Parse (data [i]);
			}
			return idata;
		}

	}
}