VB编程求200之内能整除5但不能整除3的数
3个回答
展开全部
运行后在窗体上单击即可 代码如下
Private Sub Form_click()
For i = 1 To 200
If i Mod 5 = 0 And i Mod 3 <> 0 Then
Print i;
k = k + 1
If k Mod 9 = 0 Then Print '输出9个就换行
End If
Next i
End Sub
Private Sub Form_click()
For i = 1 To 200
If i Mod 5 = 0 And i Mod 3 <> 0 Then
Print i;
k = k + 1
If k Mod 9 = 0 Then Print '输出9个就换行
End If
Next i
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
抢个沙发!
S=""
for i=0 to 200 step 5
if i mod 3 <> 0 then S=S & i & ","
next i
Msgbox S
S=""
for i=0 to 200 step 5
if i mod 3 <> 0 then S=S & i & ","
next i
Msgbox S
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
dim iRes5 as Integer
dim iRes3 as Integer
dim i as Integer
for i=0 to 200
iRes5 =i mod 5;
iRes3 =i mod 3;
if iRes5 =0 and iRes3>0 then
debug.print i;
end if
next
dim iRes3 as Integer
dim i as Integer
for i=0 to 200
iRes5 =i mod 5;
iRes3 =i mod 3;
if iRes5 =0 and iRes3>0 then
debug.print i;
end if
next
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询