标签:斐波那契 color class else return ... turn code span
1 /**PHP 斐波那契数列:1 1 2 3 5 8 13 21 34 .....**/ 2 function fun($n){ 3 if ($n<=0){ 4 return 0; 5 } else if ($n<=1){ 6 return 1; 7 } else { 8 return fun($n-1) + fun($n-2); 9 } 10 } 11 echo fun(9);
标签:斐波那契 color class else return ... turn code span
原文地址:http://www.cnblogs.com/justdoyou/p/7154827.html