编写程序,用随机数产生30个三位正整数,计算井输出这30个数的平均值。要求输出数据时,每6个数一行。
Private Sub Commandl_Click()Dim i, j, sum As Integer, a(30) As Integer For i =1 To 30a(i) = Int(100 + 900 * Rnd)Nextsum = 0For i = 1 To 30sum = sum + a(i)print a(i)If i Mod 6 = 0 Then printNextPrintPrint “这 30 个数的平均值为:”,sum/30 End Sub