请给下面程序中的 If I = 0 Then这一句解释一下,Const n = 10Dim data()Private Sub Form_Load()Me.AutoRedraw = TrueReDim data(n)For I = 1 To ndata(I) = 10 * IPrint data(I);NextEnd SubPrivate Sub Command1_Click()Dim I%,J%,x%Static m%Print:Pr
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 23:24:39
请给下面程序中的 If I = 0 Then这一句解释一下,Const n = 10Dim data()Private Sub Form_Load()Me.AutoRedraw = TrueReDim data(n)For I = 1 To ndata(I) = 10 * IPrint data(I);NextEnd SubPrivate Sub Command1_Click()Dim I%,J%,x%Static m%Print:Pr
请给下面程序中的 If I = 0 Then这一句解释一下,
Const n = 10
Dim data()
Private Sub Form_Load()
Me.AutoRedraw = True
ReDim data(n)
For I = 1 To n
data(I) = 10 * I
Print data(I);
Next
End Sub
Private Sub Command1_Click()
Dim I%,J%,x%
Static m%
Print:Print
x = Val(InputBox("输入插入的数据值"))
m = m + 1
ReDim Preserve data(n + m) '扩大数组长度
For I = n + m - 1 To 1 Step -1
If x >= data(I) Then
I = I + 1 '新数据的插入位置
Exit For
End If
Next
For J = n + m - 1 To I Step -1
data(J + 1) = data(J) '从插入点的位置开始,所有元素挪一个位置
Next
If I = 0 Then
data(I + 1) = x '插入新数据
Else
data(I) = x
End If
For I = 1 To n + m
Print data(I); '显示所有元素
Next
End Sub
请给下面程序中的 If I = 0 Then这一句解释一下,Const n = 10Dim data()Private Sub Form_Load()Me.AutoRedraw = TrueReDim data(n)For I = 1 To ndata(I) = 10 * IPrint data(I);NextEnd SubPrivate Sub Command1_Click()Dim I%,J%,x%Static m%Print:Pr
If I = 0 Then
这句的意思是 如果 I的值等于0,那么判断成立,执行判断成立以后的语句