c 递归算法
?
#include <stdio.h>double factorial(unsigned int i) {if(i <= 1){return 1;}return i * factorial(i - 1); } int main() {int i = 15;printf("%d 的階乘為 %f\n", i, factorial(i));return 0; }?
轉(zhuǎn)載于:https://www.cnblogs.com/sea-stream/p/9822437.html
總結(jié)
- 上一篇: Android L(5.0)源码之图形与
- 下一篇: [转]为mysql数据库建立索引