用VB 编写一个过程统计数组中元素个数,最大值,最小值和平均值,并设

用VB 编写一个过程统计数组中元素个数,最大值,最小值和平均值,并设计程序调用测试该过程
最新回答
迩璇大爺哟ˇ

2024-04-18 01:52:33

个数=Ubound()-Lbound()
max=a(lbound()):min=a(lbound()):sum=0
for
i=Lbound()+1
to
Ubound()
if
max<a(i)
then
max=a(i)
if
min>(ai)
then
min=a(i)
sum=sum+a(i)
next
i
msgbox
"最大值是"
&
str(max):"最小值是"
&
str(min):"平均值是"str(sum/个数)