Java?????
???????????? ???????[ 2012/10/8 10:21:09 ] ????????
?????????????????????????????????????????????Java??????????Java??????????????
????????????????????????????С???????????????????????÷???????????????????????????????????Ч??????????????????????
????????????????????
????1????????????????????
????2?????????????????????????????????????????????????????
????3????????????????ú???????????????????Ч??????????????????????????
????4????????????????????????????????????????????洢???????????????????????????????????????????????
????????????????“???”????????????
?????????ε????????????????С(????????)??
???????????????????????н?????????????????????????(??????ε???????????ε?????)??
???????????????????С???????????????????????е???????????ε????????????????(????δ?????????С?????)?????????????y??????????????????????????
???????????????????????????????£?
?????????????????Fibonacci???е??10??λ?????????????????У?Fibonacci Sequence??????????????У????????????????У?1??1??2??3??5??8??13??21??……???????????????????????±????????????壺F0=0??F1=1??Fn=F(n-1)+F(n-2)??n>=2??n∈N*????
?????????嵥??
/**
*<p>Title:Java????????</p>
*<p>Description:???????????Fibonacci???е?5???????</p>
*<p>Copyright:Copyright(c) 2012</p>
*<p>Filename:Fibonacci.java</p>
*@author??·??
*@version1.0
*/
public class Fibonacci
{
/**
*?????????????Fibonacci???е?????
*?????????int n
*?????????int
*/
public static int fun(int n)
{
if(1==n || 2==n)
{
return 1;
}
else
{
return (fun(n-1) + fun(n-2));
}
}
/**
*????????????????
*?????????String[] args
*?????????void
*/
public static void main(String[] args)
{
System.out.println(fun(10));
}
}
???????н???????????
????55
???????
????1?????????????????????????????????????
????2?????????????????????????????????????????
????3???????????????????Ч??????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11