( 11 )下列程序的功能是找出被 5 、 7 除,余数为 1 的最小的 5 个正整数。请在程序空白处填入适当的语句,使程序可以完成指定的功能。
Private Sub Form_Click()
Dim Ncount %, n%
n = n + 1
If 【 11 】 Then
Debug.Print n
Ncount =Ncount + 1
End If
Loop Until Ncont = 5
End Sub
第1题:
下列程序的功能是求方程:x2+y2=1000的所有整数解。请在空白处填入适当的语句,使程序完成指定的功能。
Private Sub Command 1_Click()
Dim x as intege,y as integer
For x=-34 To 34
For y=-34 To 34
If______Then
Debug.print x,Y
End If
Next y
Next x
End Sub
第2题:
在窗体中添加一命令按钮,(其Name属性为Commmld1),然后编写代码。程序的功能是产生100个小于1000(不含1000)的随机正整数,并统计其中5的倍数所占比例。
请在空白处填入适当的内容,将程序补充完整。
Private Sub Command1 Click()
Dim a(100)
For j=1 To 100
a(j)=Int(______)
If a(j)______5=0 Then______
Print a (j);
Next i
Print k/100
End Sub
第3题:
找出被3、5、7除,余数均为1的最小的5个正整数。 Private Sub Command1_Click() Dim countn%, n% n =1: countn = 0 Do n= n + 1 If Then Print n countn = countn + 1 End If Loop until count n=5 End Sub
A.n mod 3=1 And n mod 5=1 And n mod 7=1
B.n mod 3=1 or n mod 5=1 or n mod 7=1
C.n 3=1 And n 5=1 And n 7=1
D.n 3=1 or n 5=1 or n 7=1
第4题:
下列程序为求Sn=a+aa+aaa+……+aa…a(n个a),其中a为一个随机数产生的1~9(包括1、 9)中的一个正整数,n是一个随机数产生的5~10(包括5、10)中的一个正整数,请在空格处填入适当的内容,将程序补充完整。
Private Sub Form_CUCk()
Dima As Integer,n As Intege,S As Double,Sn As Double
a=Fix(9*Rnd)+1
n=Pix(6*Rnd)+5
Sn=0
S=0
Fori
第5题:
试题10
下列程序段的功能是求1到100的累加和。请在空白处填入适当的语句,使程序完成指定的功能。
Dim s As Single , m As Single
s=0
m=1
do while ____【10】___
s=s+m
m=m+1
Loop