Dim x(100), a For i = 1 To 100 x(i) = i Next i For Each a In x() s = s

问题描述:

Dim x(100), a For i = 1 To 100 x(i) = i Next i For Each a In x() s = s
s = s + a
Next
Label1.Caption = s
Static n As Integer, m As Integer
m = 100: n = 0: s = 0
For Each x In a
If x > n Then n = x
If x s = s + x
Next
MsgBox "最大值为:" & n & Chr(13) & "最小值为:" & m & Chr(13) & "平均值为:" & s / 10

Dim x(1 To 100),a,sFor i = 1 To 100x(i) = iNext iFor Each a In xs = s + aNextLabel1.Caption = sDim n As Integer,m As Integerm = 100:n = 0:s = 0For Each a In xIf a > n Then n = aIf a