2个矩阵相加,For i = 1 To 4For j = 1 To 4c(i,j) = a(i,j) + b(i,j)Picture3.Print c(i,j);If i = 1 And j = 1 ThenMax = c(i,j)ElseIf Max < c(i,j) Then Max = c(i,j):n = i:m = jEnd IfNext jPicture3.PrintNext i这个和For i = 1 To 4For j = 1 To 4c(i,j)
来源:学生作业帮助网 编辑:六六作业网 时间:2025/01/30 17:50:52
2个矩阵相加,For i = 1 To 4For j = 1 To 4c(i,j) = a(i,j) + b(i,j)Picture3.Print c(i,j);If i = 1 And j = 1 ThenMax = c(i,j)ElseIf Max < c(i,j) Then Max = c(i,j):n = i:m = jEnd IfNext jPicture3.PrintNext i这个和For i = 1 To 4For j = 1 To 4c(i,j)
2个矩阵相加,
For i = 1 To 4
For j = 1 To 4
c(i,j) = a(i,j) + b(i,j)
Picture3.Print c(i,j);
If i = 1 And j = 1 Then
Max = c(i,j)
ElseIf Max < c(i,j) Then Max = c(i,j):n = i:m = j
End If
Next j
Picture3.Print
Next i
这个和
For i = 1 To 4
For j = 1 To 4
c(i,j) = a(i,j) + b(i,j)
Picture3.Print c(i,j);
next j
picture3.print
next i
end sub
效果一样啊,谁能给我说区别啊
2个矩阵相加,For i = 1 To 4For j = 1 To 4c(i,j) = a(i,j) + b(i,j)Picture3.Print c(i,j);If i = 1 And j = 1 ThenMax = c(i,j)ElseIf Max < c(i,j) Then Max = c(i,j):n = i:m = jEnd IfNext jPicture3.PrintNext i这个和For i = 1 To 4For j = 1 To 4c(i,j)
才看到你这个
第一段比第二段多了这段代码:
If i = 1 And j = 1 Then
Max = c(i,j)
ElseIf Max < c(i,j) Then Max = c(i,j):n = i:m = j
End If
这是在求两个矩阵的和 C 中元素的最大值
你显示一下 Max 就知道了,它位于C的第n行第m列.