blsn.net
当前位置:首页 >> VB编程题:求二维数组A(m,n)中的最大值以及最大... >>

VB编程题:求二维数组A(m,n)中的最大值以及最大...

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

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(3, 2) As Integer, aa(2, 3) As Integer Private Sub Form_Load() Dim i As Integer, j As Integer Print "转置前;" For i = 1 To 3 For j = 1 To 2 a(i, j) = Int(Rnd * 51 + 50) Print a(i, j); Next j Print Next i Print "转置后:" F...

Private Sub Command1_Click() Cls Randomize (Timer) Dim m As Integer, n As Integer Dim a() As Integer m = InputBox("m=", "", 5) n = InputBox("n=", "", 10) ReDim a(1 To m, 1 To n) For i = 1 To m For j = 1 To n a(i, j) = Int(Rnd *...

Private Sub Command1_Click() Dim max Randomize Dim a(1 To 3, 1 To 3) max = 0 For i = 1 To 3 For j = 1 To 3 a(i, j) = Int(Rnd * 101) Print a(i, j); Next j, i Print For i = 1 To 3 For j = 1 To 3 If a(i, j) > max Then max = a(i, j...

#include void main() {int a[3][4]={{1,2,3,4},{5,6,7,8},{9,10,11,12}}; int i,j,c,d,max; max=a[0][0]; for(i=0;i

Private Sub Form_Click() Dim a(5, 5) As Integer Randomize Max = -999 i1 = 0: j1 = 0 For i = 1 To 5 s = 0: M = -999 For j = 1 To 5 a(i, j) = Rnd * 200 Print Tab(5 * j - 3); a(i, j); s = s + a(i, j) If a(i, j) > M Then M = a(i, j...

是下界吧? 用LBound函数:LBound(array,dim) 其中array是数组名,dim是数组维数 例如: Public Sub main() Dim a(1 To 4,6 To 8) As Long MsgBox LBound(a, 1) '显示1 MsgBox LBound(a, 2) '显示6 MsgBox UBound(a, 1) '显示4 MsgBox UBound(a,...

要看具体设置: option base:在模块级别中使用,用来声明数组下标的缺省下界 option base后面只能是0或者1 由于默认是0 所以是0的时候可以不用option base语句 只有当你想Option Base 语句来取代数组下标的缺省值 0时才有必要用option base 1而...

#include intmain() { int a[3][4],max,x,y,i,j; printf("请输入:\n"); for(i=0;i

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