当前位置:百科知识 > 工学题库2

问题描述:

[单选] 设有一个递归算法如下: int fact(int n){ //n大于等于0 if(n<=0)return 1; else return n*fact(n-1); } 则计算fact(n)需要调用该函数的次数为()
A.n+1 B.n-1 C.n D.n+2
参考答案:查看
答案解析:
☆收藏

随机题目