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

'新建一个工程,在form中添加一个按钮,按钮中写上以下代码即可 Private Sub Command1_Click() Dim n As Long, m As Long Dim i As Long, j As Long Dim x As Long, y As Long, z As Long Dim a() As Long n = Val(InputBox("输入N", "输入N", 1))...

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 str As String = "" Dim a(9, 9), i, j, temp As Integer For i = 1 To 9 For j = 1 To 9 a(i, j) = Int(Rnd() * 90 + 10) str = str & a(i, j).ToString & " " Next str = str & vbCrLf Next str = str & vbCrLf temp = a(1, 1) For i = 1...

Private Sub Command1_Click()Dim m, n, i, j, t, pm = Val(InputBox("", "", 5))n = Val(InputBox("", "", 6))For i = 1 To m For j = 1 To n t = Int(Rnd * 10) Print t; If p < t Then p = t Next Print " "; p p = 0NextEnd Sub

Private Sub Command1_Click() Dim i As Integer, j As Integer, n As Integer n = CStr(Text1) For i = 1 To n For j = 1 To n If i = j Then Print "1 "; Else Print "0 "; End If Next j Print Next i End Sub Private Sub Command2_Click() ...

这个可以的,我调试了。 Private Sub Command1_Click() Dim a(1 To 5, 1 To 5) As Integer Dim i As Integer, j As Integer, hanghao As Integer For i = 1 To 5 For j = 1 To 5 a(i, j) = Int(Rnd * 100) + 1 '产生1到100随机数字 Print Tab((j...

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

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

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

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