#2
加法2022-12-12 11:36
|
public static void main(String[] args){
int n = 10;
System.out.println("第"+n+"个月兔子总数为"+fun(n));
}
private static int fun(int n){
if(n==1 || n==2)
return 0;
else
return fun(n-1)+fun(n-2);
}
}
[此贴子已经被作者于2022-12-10 08:10编辑过]