早教吧作业答案频道 -->数学-->
VB100到200之间随机产生25个数字,5*5排列,要一维和二维两种方法
题目详情
VB100到200之间随机产生25个数字,5*5排列,要一维和二维两种方法
▼优质解答
答案和解析
Private Sub Command1_Click()
' 一维
Dim mArr%(1 To 25), i%
For i = 1 To 25
Randomize
mArr(i) = Int(Rnd * 101) + 100
Print mArr(i),
If i Mod 5 = 0 Then Print
Next i
End Sub
Private Sub Command2_Click()
'二维
Dim mArr2(1 To 5, 1 To 5), r%, c%
For r = 1 To 5
For c = 1 To 5
Randomize
mArr2(r, c) = Int(Rnd * 101) + 100
Print mArr2(r, c),
Next c
Print
Next r
End Sub
' 一维
Dim mArr%(1 To 25), i%
For i = 1 To 25
Randomize
mArr(i) = Int(Rnd * 101) + 100
Print mArr(i),
If i Mod 5 = 0 Then Print
Next i
End Sub
Private Sub Command2_Click()
'二维
Dim mArr2(1 To 5, 1 To 5), r%, c%
For r = 1 To 5
For c = 1 To 5
Randomize
mArr2(r, c) = Int(Rnd * 101) + 100
Print mArr2(r, c),
Next c
Next r
End Sub
看了 VB100到200之间随机产...的网友还看了以下:
直接写得数2005-601=9÷23=1.05-0.25=0.25×0.125=1154+846= 2020-04-07 …
pa=0.5,pb=0.3,pab=0.1求p(aUb),答案是0.5+0.3-0.1=0.7我. 2020-04-12 …
请帮我算下这个数独的答案,{4,2,0,0,9,0,0,0,0}{5,0,7,3,0,0,0,0, 2020-04-26 …
ansys直接建立有限元模型问题finish/clear/prep7n,1,0,0,0n,2,0, 2020-05-17 …
5.0%V/V是多少ppm 2020-06-08 …
下列几个数:-1.5、0、0.5、23、+1,按从小到大的顺序排列是()A.0<-1.5<23<0 2020-06-11 …
口算3.6÷1.8=4.71-0.8=2.5-2.5÷5=0÷3.15=0.175÷0.25÷4= 2020-07-18 …
心算.0.5×5=0.18+0.82=2.1+0.6+7.9=0.6÷0.2=0.09×1000=0 2020-10-30 …
心算.2.5÷0.5=3÷0.5=4.5÷0.09=4.9÷0.7=2÷0.4=0.3÷0.05=0 2020-10-30 …
直接写出得数7.98+0.3=5-2.6=1.4×0.5=3.2÷0.16=1÷0.25=0.7×0 2020-11-19 …