标签:递归 求1+2+3+....+10
# 递归 求1+2+3+....+10function sum($total = 0,$num){ $total += $num; if($num == 1) { return $total; }else{ return sum($total,$num -1); }}echo sum(0,10);
result:55
递归 求1+2+3+....+10
原文地址:http://11873993.blog.51cto.com/11863993/1876810