用计算机语言编写求5个数的平均值的程序(自定指令系统)

发布时间:2024-11-08 03:44 发布:上海旅游网

问题描述:

如题

谢谢.

问题解答:

VB的:

Dim result As Integer, a(5) As Integer, i As Integer
result = 0
a(1) = 10
a(2) = 20
a(3) = 30
a(4) = 40
a(5) = 50
For i = 1 To 5
result = result + a(i)
Next
result = result / 5

热点新闻