using System public class Frog public static int Fib int int resault i

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
public class Frog
{
public static int Fib(int n)
{
int resault = 0;
if (n == 0)
return 0;
if (n == 1)
return 1;
if (n > 1)
return Fib(n - 1) + Fib(n - 2);
return resault;
}
public static int NumberOfWays(int n)
{
return Fib(n+1);
}
public static void Main(String[] args)
{
Console.WriteLine(NumberOfWays(3));
}
}