、* 产生50个60~100的随机数,统计其中被6整除余2的个数,并输出总个数。
* 程序代码如下:
Private Sub command1_click()
Dim x%, n As Integer
Dim counter As Integer
For _______= 1 To 50
x= int(________ * 41+60)
If x Mod 6 = 2 Then
Print x;
counter =counter+1
End If
Next n
print
Print counter
End Sub
--------------------------------------------------------------------------------
2、* 使用双循环实现平行四边形形输出
**********
**********
**********
**********
**********
* 程序代码如下:
Private Sub Command1_Click()
For i = 1 To 5
Print Tab(25 + i )______
For j = 1 To 10
Print "________";
Next j
Print
Next i
End Sub
--------------------------------------------------------------------------------
3、* 利用随机函数产生20个10~99之间的随机整数存入一维数组A,然后分四行用标准打印格式打印输出,每行五个数。
Private Sub Form_Click()
Dim ______(20) As Integer, i As Integer
For i = 1 To 20
a(i) = Int(Rnd * 90 + 10)
If_______ Mod 5=0 Then
Print a(i)
Else
Print a(i),
End If
Next i
End Sub
--------------------------------------------------------------------------------