zpxc.net
当前位置:首页 >> vB 编写一个应用程序,要求产生一个二维数组,并按图... >>

vB 编写一个应用程序,要求产生一个二维数组,并按图...

Private Sub Command1_Click() Dim a(4, 4) As Integer For i = 0 To 4 For j = 0 To 4 a(i, j) = i + j Next j Next i For i = 0 To 4 For j = 0 To i Picture1.Print a(i, j); Next j Picture1.Print Next i For i = 0 To 4 Picture2.Print Sp...

Option Base 1 Private Sub Command1_Click() Dim A(5, 5) As Integer, B(5, 5) As Integer For x = 1 To 5 For y = 1 To 5 A(x, y) = Int(10 + Rnd * 90) '随机产生两位数的整数 Print A(x, y); '输出 Next Print Next Print For x = 1 To 5 Fo...

Private Sub form_Click()Dim sc%(3, 3) For i = 0 To 3 For j = 0 To 3 sc(i, j) = Int(Rnd * 101) Next j Next i Picture1.Print For i = 0 To 3 For j = 0 To i Picture1.Print Tab(j * 5); sc(i, j); 'TAB中的列数倍适当大一点就整齐了 Next...

Dim n, m As Integer n = InputBox("请输入二维数组的行数") m = InputBox("请输入二维数组的列数") Dim a(n, m) As Integer For i = 1 To n For j = 1 To m a(i, j) = Int(Rnd() * 100 + 1) Next Next

程序已经完成,请采纳: Private Sub Command1_Click() Dim a(3, 4) As Integer For i = 1 To 3 For j = 1 To 4 a(i, j) = Int(10 + 90 * Rnd) Print a(i, j); Next j Print Next i End Sub

dim a(4,4) as integer,s as integer s=0 a(1,1)=15 a(1,2)=30 a(1,3)=70 a(1,4)=11 a(2,1)=14 a(2,2)=25 a(2,3)=90 a(2,4)=100 a(3,1)=77 a(3,2)=8 a(3,3)=21 a(3,4)=30 a(4,1)=55 a(4,2)=40 a(4,3)=31 a(4,4)=52 for i=1 to 4 print a(i,i) ne...

Private Sub Command1_Click() Dim a(3, 4) As Integer Dim b(3) As Integer Dim i As Integer, j As Integer Cls Print "形成的数组和每一行的总和(最后一个数字是总和):" For i = 1 To 3 For j = 1 To 4 a(i, j) = Int(Rnd * 90) + 10 Next...

Private Sub Command1_Click() Dim a(6, 6) As Integer Max = -1: Min = 10000 For i = 1 To 6 s = 0 For j = 1 To 6 If i = j Or i + j = 7 Then a(i, j) = 1 Else a(i, j) = Int(Rnd * 30) s = s + a(i, j) Print Tab(4 * j - 3); a(i, j); Ne...

Private Sub Command1_Click() Cls Dim arInt(1 To 4, 1 To 4) As Integer Dim r As Integer, c As Integer For c = 1 To 4 For r = 1 To 4 arInt(r, c) = Int(Rnd * 10) Print arInt(r, c); Next Print Next Dim mun As Integer For r = 1 To 4...

Dim a(2, 3) As Integer Dim i As Integer Dim j As Integer Dim Sum As Long Dim Avg As Double For i = 0 To 2 For j = 0 To 3 Randomize a(i, j) = Int(Rnd * 65536) - 32768 Print a(i, j); If j = 3 Then Print Sum = Sum + a(i, j) Next N...

网站首页 | 网站地图
All rights reserved Powered by www.zpxc.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com