vb程序Dim a(1 To 20) As Integer,i As Integer,j As Integer
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/11 04:13:35
vb程序Dim a(1 To 20) As Integer,i As Integer,j As Integer
Dim a(1 To 20) As Integer,i As Integer,j As Integer
Private Sub Command1_Click()
Dim a(1 To 20) As Integer
For j = 1 To 2
For i = 1 To 10
a(i) = Int(Rnd * 21) + 20
Text1 = Text1 & Str(a(i))
Next i
Text1 = Text1 & vbCrLf
Next j
End Sub
Private Sub Command2_Click()
Dim b(20 To 40) As Integer
a(i) = Int(Rnd * 21) + 20
b(a(i)) = 0
For i = 1 To 20
b(a(i)) = b(a(i)) + 1
Text2 = b(a(i)) & vbCrLf
Next i
End Sub
为什么数组越界 哪出错啦
这个 程序要实现的是 产生20个20—40间的两位随机数 统计不同数据出现的次数
Dim a(1 To 20) As Integer,i As Integer,j As Integer
Private Sub Command1_Click()
Dim a(1 To 20) As Integer
For j = 1 To 2
For i = 1 To 10
a(i) = Int(Rnd * 21) + 20
Text1 = Text1 & Str(a(i))
Next i
Text1 = Text1 & vbCrLf
Next j
End Sub
Private Sub Command2_Click()
Dim b(20 To 40) As Integer
a(i) = Int(Rnd * 21) + 20
b(a(i)) = 0
For i = 1 To 20
b(a(i)) = b(a(i)) + 1
Text2 = b(a(i)) & vbCrLf
Next i
End Sub
为什么数组越界 哪出错啦
这个 程序要实现的是 产生20个20—40间的两位随机数 统计不同数据出现的次数
在 Command2_Click() 中
你还有没有定义i,就开始使用a(i)了
而且没有定义的变量初始值是0
而你的a是1 到20 的,根本就没有0
你还有没有定义i,就开始使用a(i)了
而且没有定义的变量初始值是0
而你的a是1 到20 的,根本就没有0
vb程序Dim a(1 To 20) As Integer,i As Integer,j As Integer
Dim ia(1 To 10) As Integer,imin As Integer,n As Integer,i As
Dim a(9) As Integer,x As Integer,k As Integer,I As Integer R
VB dim x as integer dim i as integer x = 100 for i = 1 to 10
Dim a(1 To 10) As Integer Dim i As Integer a(1) = 1 For i =
VB中的Dim sum As Integer语句
Function fun(a As Integer,n As Integer) As Integer
dim a(3,2) as integer
英语翻译Private Sub Form_Click()Dim a(1 To 10) As Integer,i%,max
dim i as integer dim sum as integer sum=0 for i=0 to 5 sum=s
Private Sub Command1_Click() Dim i,j As Integer For i = 3 To
dim a(10,10) as integer for i=1 to 10 for j=1to 10 a(i,j)=i*