展开全部
For i = 1 To 5
For j = 1 To 5
a(i, j) = Int(Rnd * 90) + 10
Next j
Next i
For i = 1 To 5
For j = 1 To 5
Picture1.Print a(i, j);
Next j
Picture1.Print
Next i
s = 0
For i = 1 To 5
For j = 1 To 5
s = s + a(i, j)
Next j
Next i
s1 = 0
For i = 1 To 5
s1 = s1 + a(1, i) + a(5, i)
s1 = s1 + a(i, 1) + a(i, 5)
Next i
s2 = 0
For i = 1 To 5
For j = 1 To 5
If i = j Or i = 6 - j Then
s2 = s2 + a(i, j)
End If
Next j
Picture1.Print
Next i
Picture1.Print "靠边元素的和" & s1 & "对角线元素的和" & s2 & "所有和" & s
For j = 1 To 5
a(i, j) = Int(Rnd * 90) + 10
Next j
Next i
For i = 1 To 5
For j = 1 To 5
Picture1.Print a(i, j);
Next j
Picture1.Print
Next i
s = 0
For i = 1 To 5
For j = 1 To 5
s = s + a(i, j)
Next j
Next i
s1 = 0
For i = 1 To 5
s1 = s1 + a(1, i) + a(5, i)
s1 = s1 + a(i, 1) + a(i, 5)
Next i
s2 = 0
For i = 1 To 5
For j = 1 To 5
If i = j Or i = 6 - j Then
s2 = s2 + a(i, j)
End If
Next j
Picture1.Print
Next i
Picture1.Print "靠边元素的和" & s1 & "对角线元素的和" & s2 & "所有和" & s
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询