作业帮 > 数学 > 作业

生成10个0~100之间的随机整数,按从小到大的顺序输出这些数

来源:学生作业帮 编辑:作业帮 分类:数学作业 时间:2024/11/05 22:56:12
生成10个0~100之间的随机整数,按从小到大的顺序输出这些数
Private Sub Form_Load()
Randomize
Dim intRnd As Integer
Dim strRnd As String
Dim strOushu As String
Dim i As Integer
For i = 0 To 9
intRnd = Int(rnd * 100)
strRnd = strRnd & intRnd & ","
If intRnd Mod 2 = 0 Then strOushu = strOushu & intRnd & ","
Next
Label1.Caption = strRnd
Label2.Caption = strOushu
End Sub
请参考