1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Public Class Form1
Dim num()
Dim N As Integer


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim N, i As Integer
N = Val(InputBox("請輸入數字個數"))
ReDim num(0 To N)
For i = 1 To N
num(i) = InputBox("第" & i & "個數字")
Next i

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim N, i As Integer

For i = 1 To N
Print i
Next i

End Sub
End Class