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 xy(10,10)For i = 1 To 10For k = 1 To 10xy(i, k) = i * kNextNext '这一段赋值,具体要怎么赋值,自己看着办For i = 1 To 10’这里开始就是输出咯,我用的是msgbox,你在界面上弄些文本框也可以。For k = 1 To 10MsgBox (xy(i, k))NextNext

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

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(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() Dim abc(3, 3) As Integer Dim abcMax As Integer Dim abcMin As Integer Dim i As Integer Dim j As Integer Dim iMax As Integer Dim jMax As Integer Dim iMin As Integer Dim jMin As Integer Dim abcSum As I...

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...

这个很简单,本程序用VB6.0编写 新建一窗体,在窗体上放一个picture控件,与一个command控件,然后在代码窗口里粘贴以下代码即可。 Private Sub Command1_Click()Dim a(3, 4) As LongDim i As LongDim j As LongPicture1.Cls For i = 0 To 4 For...

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