Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text.RegularExpressions;
- namespace ConsoleApp1
- {
- class Program
- {
- static int count(int n)
- {
- if (n == 1 || n == 2)
- return n;
- return count(n - 1) + count(n - 2);
- }
- static void Main(string[] args)
- {
- int res = count(5);
- Console.WriteLine(res);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement