Advertisement
mess0011

u3_6

Oct 17th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication24
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int[,] series = new int[25, 1];
  14.             series[0, 0] = 1; // F0
  15.             series[1, 0] = 1; // F1
  16.  
  17.             for (int i = 2; i<25; i++)
  18.             {
  19.                 series[i, 0] = series[i - 1, 0] + series[i - 2, 0]; // Fn = F(n-1) + F(n-2)
  20.                 Console.WriteLine(series[i, 0]);
  21.             }
  22.             Console.ReadLine();
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement