Java 代码
import java.util.Scanner;
public class Main
{
public static int count = 0;
public static int stair = 0;
public static void path (int k)
{
if (k == stair)
count += 1;
if (k > stair)
return;
path (k + 2);
path (k + 1);
}
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
stair = cin.nextInt();
path(0);
System.out.println(count);
}
}