package fangzao.www;
public class test{
public static void main(String[] args) {
test e = new test();
// System.out.println();
System.out.println("结果是"+e.Test(5));
}
public double Test(double index) {
if (index == 1) {
return 1;
}
if (index == 2) {
return 1;
}
//double namber=Test(index-1) + Test(index - 2);
System.out.println(index);
return Test(index-1) + Test(index - 2);
}
}
java 递归
最新推荐文章于 2024-01-09 20:31:27 发布