static void Main(string[] args)
        {
            Fibbonacci   fi = new Fibbonacci();
            TriangleNums tn = new TriangleNums();

            int[] sum = new int[7];
            int   cnt = 0;

            foreach (int numb in fi.NextMemb(7))
            {
                Console.Write(numb + " ");
                sum[cnt++] = numb;
            }
            Console.WriteLine();
            cnt = 0;
            foreach (int numb in tn.NextMemb(7))
            {
                Console.Write(numb + " ");
                sum[cnt++] += numb;
            }
            Console.WriteLine();
            foreach (int numb in sum)
            {
                Console.Write(numb + " ");
            }
            Console.WriteLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            Fibbonacci    fi = new Fibbonacci();
            TriangleNumbs tn = new TriangleNumbs();

            foreach (int numb in fi.nextMemb(7))
            {
                Console.Write(numb + "  ");
            }

            Console.WriteLine();


            foreach (int numb in fi.nextMemb(7))
            {
                Console.Write(numb + "  ");
            }

            Console.WriteLine($"{Environment.NewLine}----------------------------------");

            foreach (int numb in tn.GetEnumerable(7))
            {
                Console.Write(numb + "  ");
            }

            Console.WriteLine();

            foreach (int numb in tn.GetEnumerable(7))
            {
                Console.Write(numb + "  ");
            }

            Console.WriteLine();
        }