Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using java.util;
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SoftSvetlina
- {
- class Program
- {
- static int Factorial(int n)
- {
- if (n == 0)
- {
- return 1;
- }
- return Factorial(n - 1) * n;
- }
- static void CountDown(int start)
- {
- if (start == -10)
- {
- return;
- }
- Console.WriteLine(start);
- CountDown(start - 1);
- }
- static int fib(int n)
- {
- if (n == 0)
- {
- return 0;
- }
- else if (n == 1)
- {
- return 1;
- }
- return fib(n - 1) + fib(n - 2);
- }
- static void Main()
- {
- Console.WriteLine(fib(12));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement