目录
import java.util.Scanner;
public class Rabbit {
public static void main(String [] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入月份(大于等于2):");
int month = sc.nextInt();
int[] months = new int[month];
months[0] = 1;
months[1] = 1;
for( int i = 2; i < month; i++ ) {
months[i] = months[i-2] + months[i-1];
}
System.out.println("经过" +month+"月后得到的兔子为:" +months[month-1]);
}
}