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: Wrong Answer)

using System;
using System.Linq;

class TestClass {
	static void Main(string[] args) {
		Console.Write("入力してください：");
		int[] num = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

		int count = 0;
		int[] answer = new int[3];

		foreach(int n1 in num) {//10 5 10
			foreach(int n2 in num) {
				if(n1 > n2) {
					count++;
				}
			}

			if(answer[count] == 0) {
				answer[count] = n1;
				}else{
					if(answer[count+1] == 0) {
						answer[count+1] = n1;
						}else{
							answer[count+2] = n1;
						}
				}
			count = 0;
		}

		Console.WriteLine(answer[0]+" "+answer[1]+" "+answer[2]);
	}
}