import java.util.Scanner;
public class GetRabbitNum {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
int num = scan.nextInt();
int result = fun(num);
System.out.println(result);
}
private static int fun(int num) {
if(num==0)
return 0;
else if(num ==1)
return 1;
else
return fun(num-1)+fun(num-2);
}
}
统计每个月兔子的总数
最新推荐文章于 2023-03-30 18:21:25 发布