一个很简单的vb问题

2024-12-26 01:26:57
推荐回答(3个)
回答1:

显示了,只是amax紧跟在第一行末尾打印(没换行),所以只有3行,看上去没显示。添加一个print,如下:
Next i
Print '起换行作用
Print amax
Print amin
Print ave
End Sub

回答2:

Dim a(9)
Private Sub Form_Click()
For i = 0 To 9
Randomize
a(i) = Int(Rnd * 71 + 30)
Print a(i) & " ";
s = s + a(i)
Next i
Print
ave = s / 10
amin = a(0)
amax = amin
For i = 1 To 9
If a(i) < amin Then amin = a(i)
If a(i) > amax Then amax = a(i)
Next i
Print "amax="; amax
Print "amin="; amin
Print "ave="; ave
End Sub

回答3:

Print amax
Print amin
Print ave
print后的字符串要加英文引号