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