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;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            string Inputnum = Console.ReadLine();

            string[] comparisonNum = Inputnum.Split(' ');

            SetNum(comparisonNum);
        }

        /// <summary>
        /// ??\??????????????°???????????°??????????????????????????????
        /// </summary>
        /// <param name="numList"></param>
        private static void SetNum(string[] numList)
        {
            int? a = null;
            int? b = null;
            int? c = null;

            //??\?????????????????????????????????
            foreach(var result in numList)
            {
                //string??§???????????£????????????int????????£??????
                int resultint = int.Parse(result);


                if(a == null)
                {
                    a = resultint;
                    continue;
                }

                if(b == null)
                {
                    b = resultint;
                    continue;
                }

                c = resultint;
            }

            //??\??????????????°????????????????????¨?????????
            NumReplace(a, b, c);
           
        }

        /// <summary>
        /// ??°????????\?????????????????????
        /// </summary>
        /// <param name="a">1???????????\??????????????°???</param>
        /// <param name="b">2???????????\??????????????°???</param>
        /// <param name="c">3???????????\??????????????°???</param>
        private static void NumReplace(int? a, int? b, int? c)
        {
            int? temp;

            //a??¨b????????\?????????
            if (a > b)
            {
                temp = a;
                a = b;
                b = temp;
            }


            //c?????????a??¨b??????????????´???
            if (a <= c && b >= c)
            {
                temp = b;
                b = c;
                c = temp;
            }

            //c?????????a??????????°?????????´???
            else if (a > c)
            {
                temp = a;
                a = c;
                c = b;
                b = temp;

            }

            Console.WriteLine("{0} {1} {2}", a, b, c);
        }


    }

}