用科学电子计算机怎么求平均数
来源:学生作业帮 编辑:作业帮 分类:英语作业 时间:2024/08/28 07:18:02
用科学电子计算机怎么求平均数
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 100 A(I)=I Next I '对数组求和 Total=0 For I=1 to 100 Total=Total+A(100) Next I Average=Total/100 '求数组平均值
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 100 A(I)=I Next I '对数组求和 Total=0 For I=1 to 100 Total=Total+A(100) Next I Average=Total/100 '求数组平均值