```java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("请输入几个月整数值:");
int n = scanner.nextInt();
int res = rabbit(n);
System.out.println("num=" + res);
}
private static int rabbit(int n) {
if (n <= 0) {
return 0;
} else if (n == 1 || n == 2) {
return 1;
} else {
return rabbit(n - 1) + rabbit(n - 2);
}
}
}
```