在编写一个钻石图形时,源代码如下:
Private Sub Form_click()
Dim a(9), i
a(1) = "*"
a(0) = "**"
For i = 1 To 5
a(i + 1) = a(i) + a(0)
Print Spc(5 - i); a(i)
Next
For i = 6 To 9
a(i + 1) = a(i) - a(0)
Print Spc(i - 5); a(i)
Next
End Sub
但是当运行到第二个for时,总会出错,不知该做如何修改,
在编写一个钻石图形时,源代码如下:
Private Sub Form_click()
Dim a(9), i
a(1) = "*"
a(0) = "**"
For i = 1 To 5
a(i + 1) = a(i) + a(0)
Print Spc(5 - i); a(i)
Next
For i = 6 To 9
a(i + 1) = a(i) - a(0)
Print Spc(i - 5); a(i)
Next
End Sub
但是当运行到第二个for时,总会出错,不知该做如何修改,