VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   12
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Click()
    Dim n As Integer, k As Integer, f(30) As Long
    f(1) = 1                        '给数组第1、2位元素赋值
    f(2) = 1
    For n = 3 To 30                 '利用循环计算3-30位数组元素
        f(n) = f(n - 1) + f(n - 2)
    Next n
    Cls
    Print Tab(20); "裴波纳契数列"
    Print
    k = 1                           '给打印定位变量k赋初值
    For n = 1 To 30                 '利用循环打印数组元素
        Print Tab(k * 10); f(n);
        If k = 4 Then               '每行打印4个数值后换行
            Print
            k = 0
        End If
        k = k + 1                   '更改打印位置
    Next n
End Sub

