用科学电子计算机怎么求平均数

问题描述:

用科学电子计算机怎么求平均数

Dim A(100) As Double
Dim I As Long
Dim Total As Double
Dim Average As Double
Total=0
For I=1 to 100
Total=Total+A(100)
Next I
Average=Total/100能详细一点吗Dim A(1 To 100) As Double'定义能够存储100个数的数组Dim I As Long'定义循环变量Dim Total As Double'定义“数组的和”变量Dim Average As Double'定义“数组的平均值”变量'给数组赋初值For I=1 to 100A(I)=INext I'对数组求和Total=0For I=1 to 100 Total=Total+A(100)Next IAverage=Total/100 '求数组平均值