求助!这个怎么编写?
来源:百度知道 编辑:UC知道 时间:2024/05/29 01:08:34
VB 随机函数产生5*5矩阵,数据范围33-99之间,输出矩阵,并求所有元素之和
'添加窗体Form1,按钮Command1,然后添加如下代码:
Private Sub Command1_Click()
Dim a(4, 4), i, j, temp, s As Integer
Cls
For i = 0 To 4
For j = 0 To 4
temp = Int(Rnd * 66) + 33
a(i, j) = temp
s = s + temp
Print temp;
Next
Print
Next
&nb