早教吧 育儿知识 作业答案 考试题库 百科 知识分享

有关vb的程序1、找出被3、5、7除,余数均为1的最小的5个正整数。请填空将程序补充完整。PrivateSubCommand1Click()Dimcountn%,n%Countn=0n=1don=n+1if(1)thenprint

题目详情
有关vb的程序
1、找出被3、5、7除,余数均为1的最小的5个正整数。请填空将程序补充完整。
Private Sub Command1_Click()
Dim countn%,n%
Countn=0
n=1
do
n=n+1
if (1) then
print n
countn=countn+1
end if
loop (2)
End Sub
▼优质解答
答案和解析
Private Sub Command1_Click()
Dim countn%, n%
countn = 0
n = 1
Do
n = n + 1
If n Mod 3 = 1 And n Mod 5 = 1 And n Mod 7 = 1 Then
Print n
countn = countn + 1
End If
Loop While countn < 5
End Sub