Пример #1
0
        static void Main(string[] args)
        {
            /*
             * String10Storage strs = new String10Storage();
             * strs[2] = "This index is stored by a string.";
             * strs[3] = "This index is stored by another string.";
             * strs[5] = "This index is also stored by a string.";
             * strs[7] = "This index is also stored by another string.";
             * strs[8] = "This index is stored by one more string.";
             * strs[9] = "This index is stored by another more string.";
             *
             * for (int i = 0; i < 10; i++)
             * {
             *  Console.WriteLine(strs[i]);
             * }
             */

            PrimeArray PA = new PrimeArray();

            for (int i = 1; i < 30; i++)
            {
                Console.WriteLine("Prime number {0} is : {1}", i, PA[i]);
            }
            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            /*
             * String10Storage strs = new String10Storage();
             * strs[2] = "This index is stored by a string.";
             * strs[3] = "This index is stored by another string.";
             * strs[5] = "This index is also stored by a string.";
             * strs[7] = "This index is also stored by another string.";
             * strs[8] = "This index is stored by one more string.";
             * strs[9] = "This index is stored by another more string.";
             *
             * for (int i = 0; i < 10; i++)
             * {
             *  Console.WriteLine(strs[i]);
             * }
             */

            PrimeArray PA = new PrimeArray();

            Console.WriteLine(PA[1]);
            Console.WriteLine(PA[2]);
            Console.WriteLine(PA[3]);
            Console.WriteLine(PA[4]);
            Console.WriteLine(PA[5]);
            Console.WriteLine(PA[6]);
            Console.WriteLine(PA[7]);
            Console.WriteLine(PA[8]);
            Console.WriteLine(PA[9]);
            Console.WriteLine(PA[10]);
            Console.WriteLine(PA[11]);
            Console.WriteLine(PA[541]);
            Console.WriteLine(PA[542]);
            Console.WriteLine(PA[543]);

            Console.ReadLine();
        }