填空题
下面是用来计算n的阶乘的递归函数,请将该函数的定义补充完整(注:阶乘的定义是
n!=n*(n-1)*...*2*1)。
unsigned fact(unsigned n)
if (n <= 1)
return 1;
return______;
【参考答案】
n*fact (n-1)
点击查看答案
<上一题
目录
下一题>
热门
试题
填空题
按照“先进先出”的原则组织数据的结构的是______。
点击查看答案&解析
填空题
下列程序的输出结果是______。 #include<iostream> using namespace std; Class Test public: Test()cnt++; ~Test()cnt--; static int Count()return cnt; private: static int cnt; ; int Test::cnt=0; int main() cout<<Test::Count()<< ; Test t1,t2; Test*pT3=new Test; Test*pT4=new Test; cout<<Test::Count()<< ; delete pT4; delete pT3; cout<<Test::Count()<<end1; return 0;
点击查看答案&解析
相关试题
以下程序的功能是输出1至100之间每位数...
问题处理方案的正确而完整的描述称为___...
在关系模型中,把数据看成一个二维表,每一...
有如下定义:class MA int value;publi...
下面的函数定义是某函数模板能够生成的函数...