上传者: 39401675
|
上传时间: 2022-04-27 21:33:54
|
文件大小: 64KB
|
文件类型: DOC
1、 编写程序,随机生成20个两位整数,并统计出其中小于等于60、大于60小于等于80及大于80的数据以及相应个数,结果打印输出到窗体。
Private Sub Form_Click()
For i = 1 To 20
a = Fix(Rnd() * 91 + 10)
If a <= 60 Then
x = x & a & " "
b = b + 1
End If
If a > 60 And b <= 80 Then
y = y & a & " "
c = c + 1
End If
If a > 80 Then
z = z & a & " "
d = d + 1
End If
Next i
Print "小于等于60的个数:" & b & "个," & x
Print "大于60小于等于80的个数:" & c & "个," & y
Print "大于80的个数:" & d & "个," & z
End Sub