Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace RecursiveFibonacci
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int[] arr = new int[n + 2];
- arr[0] = 1;
- for (int i = 0; i < n; i++)
- {
- arr[i + 2] = arr[i] + arr[i + 1];
- }
- Console.WriteLine(arr[n + 1]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement