分别采用递归和迭代正整数n的阶乘
已帮助 人
回答
共1条回复-
<br>递归算法:<br> int factorial(int n)<br> {<br> if(n==0) return 1;<br> else return factorial(n-1)*n;<br>}

