VB做能被7和11整除的数
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 13:44:14
subcommand1_click()dimiasinteger,sasintegers=0fori=1to100if(imod3=0andimod7=0)thens=s+inextmsgboxsen
抢个沙发!S=""fori=0to200step5ifimod30thenS=S&i&","nextiMsgboxS
dimnum3asintegerfori=1to1000ifimod3=0thennum3=num3+iendifnext
3再答:6再答:9再答:12再答:12再答:15再答:18再答:21再答:24再答:27再答:30再答:33再答:36再答:39再答:42再答:45再答:48再答:51再答:54再答:57再答:60再
count=0Fori=1To1000IFi%7==0Thencount++Nexti
SubMain()MsgBoxFunc(100,2,5)'按照要求写的例子EndSubRem参数(最大值,被整除的数的数组)FunctionFunc(n&,ParamArrayx())Dimi&,b&
dimiasinteger,iiasintegerfori=1to1999if(imod3)=0and(imod7)=0andright(i,1)=3thenii=ii+1endifnextprint
'更快的方法PrivateSubCommand1_Click()Fori=300To500step5IfiMod3=0ThenPrintiNextEndSub'最快的方法:PrivateSubComm
count=0sum=0fori=1to500ifi%3=0andi%50thencount=count+1sum=sum+inexti再问:请问这个可以用dowhile......做么?可以的话怎么
Sum=0Fori=100To300IfiMod21=0ThenSum=Sum+iEndIfNext==>优化一点:Sum=0Fori=100To300IfiMod21=0ThenSum=Sum+ii
PrivateSubForm_Click()DimiAsInteger,sumAsIntegerFori=1To100IfiMod3=0Thensum=sum+iNextPrintsumEndSu
我的是正 For i = 1 To 100 If i Mod 3 = 0&nbs
PrivateSubForm_Click()Dimx1%,x2%,count%count=0Fori=1To100x1=iMod5x2=iMod7Ifx1=0Andx2=0ThenPrinti;End
'单击窗体函数里面的代码:DimiAsInteger'从1~200DimcountAsInteger'保存所求的和Fori=1to200If(iMod5=0)And(iMod7=0)Thencount
PrivateSubCommand1_Click()DimsAsIntegerFori=100To200IfiMod3=0AndiMod70Thens=s+iNextiPrint"所求的和为:"&sE
PrivateSubForm_Click()DimiAsIntegerFori=1To100IfiMod3=0AndiMod7=0ThenPrintiEndIfNextEndSu
Dim i, j j = 0 &
PrivateSubCommand1_Click()Dimi%Text1.Text=""Fori=1To1000IfiMod17=0AndiMod37=0ThenText1.Text=Text1.Te
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e&
dimsum%,i%fori=1to40ifimod5=0thensum=sum+inextprintsum再问:mod什么意思啊没怎么听课不懂啊谢谢啊