您的位置:首页 > 其它

文章标题

2017-05-27 19:56 281 查看
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);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: