Esempio n. 1
0
            public static void Main()
            {
                Console.Write("How many rows? ");
                try
                {
                    rows = int.Parse(Console.ReadLine());
                }

                catch (System.FormatException)
                {
                    Console.WriteLine("The number of rows has to be a whole number!");
                    System.Environment.Exit(1);
                }

                if (rows > 20)
                {
                    Console.WriteLine("I have set a limit of 20.");
                    System.Environment.Exit(1);
                }

                Console.WriteLine("\n");

                PascalsTriangle.create();

                Console.WriteLine("\n");
            }