3.5用递归法解决问题解剖.pptVIP

  • 2
  • 0
  • 约小于1千字
  • 约 23页
  • 2017-04-20 发布于湖北
  • 举报
第三章 算法的程序实现;教学重点; 教学难点 ;;递归算法;递归算法;调用子程序的含义 ;递归的定义:;递归算法;Function Fa(ByVal n As Integer) As Long If n =1 Then Fa = 1 Else Fa = n * Fa(n - 1) End If End Function;自定义函数的定义格式: Function procedurename(arguments) [As type] Statements End Function 其中:procedurename 是函数名, arguments 是函数中的参数表, type 是函数返回值的数据类型, statements 是过程中的代码 调用函数的格式: Procedurename (arguments) ;分析: 可以推出下列式子:;Function Fb (ByVal N As Integer) As Long ?? If N3 Then Fb = 1 Else Fb = Fb(N-1)

文档评论(0)

1亿VIP精品文档

相关文档