Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int input = int.Parse(Console.ReadLine());
- Console.WriteLine(GetFibonacci(input));
- static int GetFibonacci(int n)
- {
- if (n == 2 || n == 1) return 1;
- int number = GetFibonacci(n - 1) + GetFibonacci(n - 2);
- return number;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement