VB VB VB VB VB VB

来源:百度知道 编辑:UC知道 时间:2024/05/22 10:15:51
输入初始值,输出100个不能被3整除的数

Dim n As Integer, i As Integer, j As Integer, ar(100) As Integer, str As String
n = TextBox1.Text
j = 0
For i = n To n + 300
If j = 99 Then
Exit For
End If
If i Mod 3 <> 0 Then
ar(j) = i
j = j + 1
End If
Next
For j = 0 To 99
If str = "" Then
str = ar(0)
Else
str = str + " " + CStr(ar(j))
End If
Next
TextBox2.Text = str
'TextBox1输入起始数,TextBox2输出
已成功调试给面红旗吧..

初始值是干吗的?