VB程序中编写循环结构程序 如对1~100之间的整数进行求和 for及Dowhile语句实现vb

兄弟有没有人讲详细点的,我想讲解下,VB程序中编写循环结构程序 如对1~100之间的整数进行求和 for及Dowhile语句实现vb
最新回答
温茶

2024-10-16 12:47:01

Private Sub Form_Click()
Dim s, i As Integer
s = 0
For i = 1 To 100
s = s + i
Next i
Print s
End Sub

Private Sub Form_Click()
Dim i, s As Integer
s = 0
i = 1
Do While i <= 100
s = s + i
i = i + 1
Loop
Print s
End Sub
有你在便心安

2024-10-16 14:33:36

dim是