Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Hello
- {
- class Program
- {
- static void Main(string[] args)
- {
- var a = F(7);
- Console.WriteLine(a);
- }
- static int F(int n)
- {
- if (n > 2)
- return F(n - 1) + G(n - 2);
- else return 1;
- }
- static int G(int n)
- {
- if (n > 2)
- return G(n - 1) + F(n - 2);
- else return 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement