vb设有一个二维组a(5,5),数组元素为两位的随机整数,试计算第三行各项的和
1个回答
展开全部
Private Sub Command1_Click()
Dim a(5, 5) As Integer
Dim i, j As Integer
For i = 1 To 5
For j = 1 To 5
a(i, j) = Int(Rnd * 90) + 10
Print a(i, j) & " ";
Next j
Next i
Dim sum As Integer
sum = 0
For i = 1 To 5
sum = sum + a(3, i)
Next i
MsgBox ("第三行各数字的和是" & sum)
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询