private sub command1_click()
dim a(4, 4) as integer '定义一个5*5的二维数组,下标从0开始
dim total as integer, max as integer, min as integer
dim i as integer, j as integer
total = 0
for i = 0 to 4
for j = 0 to 4
a(i, j) = int(inputbox("请输入数组" & i & ", " & j &"元素值"))
if i = 0 and j = 0 then '初始化max和min值
max = a(i, j)
min = a(i, j)
else '否则对max和min值进行比较
if max < a(i, j) then max = a(i, j)
if min > a(i, j) then min = a(i, j)
end if
total = total + a(i, j) ‘统计总和
print a(i, j);
next j
next i
print "最大值为:" & max
print "最小值为:" & min
print "平均值为:" & (total / (i * j))
end sub