www.ndwl.net > 求解一道VB程序设计题:定义一个二维数组A,共4行4...

求解一道VB程序设计题:定义一个二维数组A,共4行4...

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

Private Sub Command1_Click()Dim A(4, 4)'数组赋值Print "交换前:"For i = 1 To 4For j = 1 To 4A(i, j) = (i - 1) * 4 + j'数组显示Print A(i, j),NextPrintNext'交换数组的第二列和第四列For j = 1 To 4t = A(2, j)A(2, j) = A(4, j)A(4, j)...

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

Private Sub Form_Click() Dim i%, j%, s%, a(3, 3) As Integer Randomize For i = 0 To 3 For j = 0 To 3 a(i, j) = Int(Rnd * 99) Print a(i, j); Next j Print Next i For i = 0 To 3 s = s + a(i, i) + a(i, 3 - i) Next i Print s End Sub

Private Sub Command1_Click() Dim a(5, 10) As Integer For i = 1 To 5 For j = 1 To 10 a(i, j) = Int(Rnd * 90) + 10 Print a(i, j); Next j Print Next i Print For i = 1 To 5 For j = 1 To 10 If a(i, j) Mod 21 = 0 Then a(i, j) = 370 ...

Private A(1 To 4, 1 To 5) As Integer Private Sub SwitchArrE(ByVal AIndex As Integer, ByVal BIndex As Integer) Dim i, k As Integer For i = 1 To 5 k = A(AIndex, i) A(AIndex, i) = A(BIndex, i) A(BIndex, i) = k Next i End Sub Priva...

Option Base 1 Dim a(4, 5) Private Sub Command1_Click() randomize cls For i = 1 To 4 For j = 1 To 5 a(i, j) = Int(Rnd * 90 + 10) Next j Next i For i = 1 To 4 For j = 1 To 5 Print a(i, j); Next j Print Next i End Sub

Private Sub Command1_Click() Dim a() As Integer m = InputBox("请输入行数m:") n = InputBox("请输入列数n:") ReDim a(m, n) For i = 1 To m For j = 1 To n a(i, j) = InputBox("请输入a(" & i & "," & j & ")") Print a(i, j); Next j Prin...

Dim a(5, 5) Private Sub Command1_Click() Text1 = "" Randomize For i = 1 To 5 For j = 1 To 5 a(i, j) = Int(Rnd * 90) + 10 Text1 = Text1 & a(i, j) & " " Next Text1 = Text1 & vbCrLf Next End Sub Private Sub Command2_Click() For i ...

网站地图

All rights reserved Powered by www.ndwl.net

copyright ©right 2010-2021。
www.ndwl.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com