扫码购买正式版题库

  • 海量题库
  • 全真模拟
  • 专项训练
  • 预测试题
  • 押题密卷
  • 错题强化

设n的初值为正整数,设计一个递归算法如下:int fact(int n){if(n<=0)return 1;else return(n*fact(n-1));}以下叙述中,正确的是______。

单选题
设n的初值为正整数,设计一个递归算法如下:int fact(int n){if(n<=0)return 1;else return(n*fact(n-1));}以下叙述中,正确的是______。

A计算fact(n)需要执行n+2次函数调用

B计算fact(n)需要执行n+1次函数调用

C计算fact(n)需要执行n次函数调用

D计算fact(n)需要执行n-1次函数调用

最新更新

易过题库在线搜题

热门题库