07.Sort3NumbersWithNestedIfs

using System;

class NestedIfs
{
    static void Main()
    {
        Console.Write("Enter three numbers:");
        double numA = double.Parse(Console.ReadLine());
        Console.WriteLine("\n");
        double numB = double.Parse(Console.ReadLine());
        Console.WriteLine("\n");
        double numC =double.Parse(Console.ReadLine());
        Console.WriteLine("\n");

        bool checkAB =(numA > numB);
        bool checkAC=(numA>numC);
        bool equalBC =(numB == numC);

        bool checkBA =(numB > numA);
        bool checkBC=(numB>numC);
        bool equalCA =(numC == numA);

        bool checkCA =(numC > numA);
        bool checkCB=(numC>numB);
        bool equalAB =(numA == numB);
        
        bool equalABC = ((numA == numB)&&(numB == numC)&&(numA==numC));

        if (checkAB)
        {
            if ((checkAC) && (checkBC))
            {
                Console.WriteLine("{0} {1} {2}", numA, numB, numC);
                Console.WriteLine("\n");
            }
            else if ((checkAC)&&(checkCB))
            {
                Console.WriteLine("{0} {1} {2}",numA,numC,numB);
                Console.WriteLine("\n");
            }
            else if ((checkAC)&&(equalBC))
	        {
                Console.WriteLine("{0} {1} {2}", numA, numC, numB);
                Console.WriteLine("\n");
	        }
            
        }
        if (checkBA)
        {
            if ((checkBC)&&(checkAC))
            {
                Console.WriteLine("{0} {1} {2}",numB, numA, numC);
                Console.WriteLine("\n");
            }
            else if ((checkBC)&&(checkCA))
            {
                Console.WriteLine("{0} {1} {2}",numB,numC, numA);
                Console.WriteLine("\n");
            }
            else if ((checkBC) && (equalCA))
            {
                Console.WriteLine("{0} {1} {2}", numA, numC, numB);
                Console.WriteLine("\n");
            }
        }
        if (checkCA)
        {
            if ((checkCB)&&(checkBA))
            {
                Console.WriteLine("{0} {1} {2}",numC,numB,numA);
                Console.WriteLine("\n");
            }
            else if ((checkCB)&&(checkAB))
            {
                Console.WriteLine("{0} {1} {2}", numC, numA, numB);
                Console.WriteLine("\n");
            }
            else if ((checkCB) && (equalAB))
            {
                Console.WriteLine("{0} {1} {2}", numC, numA, numB);
                Console.WriteLine("\n");
            }
	    }
        if (equalABC)
        {
            Console.WriteLine("{0} {1} {2}", numA, numB, numC);
            Console.WriteLine("\n");
        }
            
    }
}