'创建数组
dim d() as integer
dim i as Integer
dim j as integer
dim m as integer
dim n as integer
dim x as integer
m=4 '设4行
n=3 '设3列
redim d(m,n) as integer
x=1
for i=1 to m
for j=1 to n
d(i,j)=x
x=x + 1
next j
next i
'求平均值,最大值,最小值
dim MyAve as single
dim MyMax as integer
dim MyMin as integer
dim t as integer
t=0
MyMax = d(1,1)
MyMin = d(1,1)
for i=1 to m
for j=1 to n
t=t + d(i,j)
if d(i,j)>MyMax then MyMax = d(i,j)
if d(i,j)<MyMin then MyMin = d(i,j)
next j
next i
print "平均值:" & t/(m*n)
print "最大值:" & MyMax
print "最小值:" & MyMin
温馨提示:答案为网友推荐,仅供参考