3个回答
展开全部
□□□□朋友,是不是嫌打字麻烦啊,应该把题的文字表述也打上来,才便于人理解。你这样很不好理解的。
只能猜一猜,等一会上代码。
新建一窗体,拖入一个Picture控件,三个命令按钮(不要用复制按钮方式),一切用默认值。然后在代码窗口里粘贴以下代码即可。
如果留下邮箱,我可以发源文件给你。
Option Explicit
Option Base 1
Private Sub Command1_Click()
Dim NumA(4, 3) As Long
Dim I As Long, J As Long, MaxA(4) As Long
For I = 1 To 4
For J = 1 To 3
NumA(I, J) = Val(InputBox("请输入矩阵第(" & I & "," & J & ")元素", "输入矩阵元素", ""))
Next J
Next I
For I = 1 To 4
For J = 1 To 3
If J = 1 Then
MaxA(I) = NumA(I, J)
Picture1.Print NumA(I, J);
Else
If MaxA(I) < NumA(I, J) Then MaxA(I) = NumA(I, J)
Picture1.Print Tab(10 * (J - 1)); NumA(I, J);
End If
Next J
Picture1.Print
Next I
For I = 1 To 4
Picture1.Print "第" & I&; "行最大的是" & MaxA(I)
Next I
End Sub
Private Sub Command2_Click()
Picture1.Cls
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
Command1.Caption = "开始"
Command2.Caption = "清除"
Command3.Caption = "退出"
Picture1.AutoRedraw = True
End Sub
只能猜一猜,等一会上代码。
新建一窗体,拖入一个Picture控件,三个命令按钮(不要用复制按钮方式),一切用默认值。然后在代码窗口里粘贴以下代码即可。
如果留下邮箱,我可以发源文件给你。
Option Explicit
Option Base 1
Private Sub Command1_Click()
Dim NumA(4, 3) As Long
Dim I As Long, J As Long, MaxA(4) As Long
For I = 1 To 4
For J = 1 To 3
NumA(I, J) = Val(InputBox("请输入矩阵第(" & I & "," & J & ")元素", "输入矩阵元素", ""))
Next J
Next I
For I = 1 To 4
For J = 1 To 3
If J = 1 Then
MaxA(I) = NumA(I, J)
Picture1.Print NumA(I, J);
Else
If MaxA(I) < NumA(I, J) Then MaxA(I) = NumA(I, J)
Picture1.Print Tab(10 * (J - 1)); NumA(I, J);
End If
Next J
Picture1.Print
Next I
For I = 1 To 4
Picture1.Print "第" & I&; "行最大的是" & MaxA(I)
Next I
End Sub
Private Sub Command2_Click()
Picture1.Cls
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
Command1.Caption = "开始"
Command2.Caption = "清除"
Command3.Caption = "退出"
Picture1.AutoRedraw = True
End Sub
展开全部
将txt的属性值依次赋给矩阵【4.3】,在用算法算出最值输出到窗体上,“开始”用callback把控件的值和算法程序连接,“清除”即把窗体的值复为“”,“退出”在退出.click事件代码中添加end就可以..
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim i As Integer, j As Integer
Dim x(1 To 4, 1 To 3) As Integer
For i = 1 To 4
For j = 1 To 3
x(i, j) = Val(InputBox("请输入矩阵第(" & i & "," & j & ")元素"))
Next
Next
Dim tmp1(1 To 4) As Integer
For i = 1 To 4
For j = 1 To 3
Picture1.Print x(i, j),
If tmp1(i) < x(i, j) Then tmp1(i) = x(i, j)
Next
Picture1.Print
Next
For i = 1 To 4
Picture1.Print "第" & Str(i) & "行的最大是" & Str(tmp1(i))
Next
End Sub
Private Sub Command2_Click()
Picture1.Cls
End Sub
Private Sub Command3_Click()
End
End Sub
Dim i As Integer, j As Integer
Dim x(1 To 4, 1 To 3) As Integer
For i = 1 To 4
For j = 1 To 3
x(i, j) = Val(InputBox("请输入矩阵第(" & i & "," & j & ")元素"))
Next
Next
Dim tmp1(1 To 4) As Integer
For i = 1 To 4
For j = 1 To 3
Picture1.Print x(i, j),
If tmp1(i) < x(i, j) Then tmp1(i) = x(i, j)
Next
Picture1.Print
Next
For i = 1 To 4
Picture1.Print "第" & Str(i) & "行的最大是" & Str(tmp1(i))
Next
End Sub
Private Sub Command2_Click()
Picture1.Cls
End Sub
Private Sub Command3_Click()
End
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询