;;递归是表达相似性对象及动作的无限性重复性构造的方法。
递归基础:定义、构造和计算的起点,直接给出。即h(0)。
递归步骤:由第n项或前n项定义第n+1项。即:h(n+1)=g(h(n),n),g是需要明确给出的,以说明h(n+1)怎样由h(n)和n构造出来。;;;;;;n1;longintFact(intn)
{intcounter;
longproduct=1;
forcounter=1tonstep1
{product=product*counter;}
/*迭代*/
returnproduc
原创力文档

文档评论(0)