コード例 #1
0
 public static void Main()
 {
     GeneralFibbonacci standardFib = new GeneralFibbonacci();
     Console.WriteLine("Standard Fibbonacci: ");
     for (int i = 1; i <= 10; i++)
     {
         Console.Write(standardFib.get(i) + " ");
     }
     Console.WriteLine("... {0} (42nd value) ...", standardFib.get(42));
     GeneralFibbonacci sexyFib = new GeneralFibbonacci(6, 9);
     Console.WriteLine("Sexy Fibbonacci: ");
     for (int i = 1; i <= 10; i++)
     {
         Console.Write(sexyFib.get(i) + " ");
     }
     Console.WriteLine("... {0} (42nd value) ...", sexyFib.get(42));
     Console.WriteLine("Element zero of the sequence is undefined: {0}",
         sexyFib.get(0));
     Console.WriteLine("And we can go arbitrarily big " + 
        "(1337th element of sexy fibonacci):\n{0}", sexyFib.get(1337));
 }
コード例 #2
0
        public static void Main()
        {
            GeneralFibbonacci standardFib = new GeneralFibbonacci();

            Console.WriteLine("Standard Fibbonacci: ");
            for (int i = 1; i <= 10; i++)
            {
                Console.Write(standardFib.get(i) + " ");
            }
            Console.WriteLine("... {0} (42nd value) ...", standardFib.get(42));
            GeneralFibbonacci sexyFib = new GeneralFibbonacci(6, 9);

            Console.WriteLine("Sexy Fibbonacci: ");
            for (int i = 1; i <= 10; i++)
            {
                Console.Write(sexyFib.get(i) + " ");
            }
            Console.WriteLine("... {0} (42nd value) ...", sexyFib.get(42));
            Console.WriteLine("Element zero of the sequence is undefined: {0}",
                              sexyFib.get(0));
            Console.WriteLine("And we can go arbitrarily big " +
                              "(1337th element of sexy fibonacci):\n{0}", sexyFib.get(1337));
        }