用vb计算10000以内用3除余2 的整数
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/28 22:27:37
正代码:For i = 1 To 10000If (i Mod 3 = 2 And&nbs
OptionExplicitPrivateSubCommand1_Click()Label1.Visible=TrueDimrAs__single___Dim____s___AsDouble_cons
在命令按钮里加上以下代码:DimiAsInteger,kAsInteger,jAsIntegerDimxAsStringj=0Fori=1To35Fork=1To35If(i*3+k*4)=100Th
dimi%fori=1to100ifimod3=1andimod5=2thenprintinext再问:你确定是这个么。再答:确定以及肯定结果是这些,你看有什么问题223752678297再问:还有7
DimiAsLongDimjAsLongDimkAsLongFori=0To100IfiMod2=0Thenj=j+iElsek=k+iNextMsgBox"偶数和:"&j&vbCrLf&"奇数和:"
阶乘n!=n*(n-1)(n-2)(n-2)···3*2*1
PrivateSubCommand1_Click()DimsAsString,nAsInteger,iAsIntegerFori=1To100n=n+iNextiPrint"1+2+3+……+100=
DimiAsLongDimCountAsLongFori=1To100If(iMod3=0)And(iMod2=0)ThenCount=Count+1Debug.PrintiEndIfNextMsgB
Private Sub Command1_Click()Dim i As Long, x As LongFor 
PrivateSubCommand1_Click()Fori=1To100Forj=1ToiFork=1TojIfi^2=j^2+k^2ThenPrinti;j;kNextkNextjNextiEnd
不好意思我好久没用vb了大概如下dimcassingledimxassinglex=inputbox("输入x")c=5*(x-32)/9printc\我以前把vb删了不能试你试试吧
s=1fori=1to10s=s*inextmsgboxs
原式=1*(3/2)*(4/3).*(100/99)然后很明显可以发现很多消去的项得到=1/2*100=50
PrivateSubCommand2_Click()DimIAsLong,SAsLongForI=1To100IfIMod2=0ThenS=S-IElseS=S+IEndIfNextPrintSEnd
PrivateSubCommand1_Click()Fori=2000To9999IfTrim(Str(i))=Trim(StrReverse(Str(i)))ThenPrintStr(i)EndIf
PrivateSubCommand1_Click()Dimi,j,tDimsumsum=1Fori=2To10t=1Forj=1Toit=t*2Nextjsum=sum+tNextiPrintsumE
2,3,5的最小公倍数是30有:31,61,91
Functionfactorial(nAsInteger)AsLongDimiAsIntegerDimretAsLongret=1Fori=1Tonret=ret*iNextifactorial=re
先写两个数列.PublicSubaa()DimabAsStringDimi,jAsIntegerDima,bAsInteger'素数序列Fori=1To1000Forj=1ToiIfiModj=0An
vb6测试通过PrivateSubCommand1_Click()Dima(10)AsInteger,tempAsInteger,iAsInteger,jAsIntegerRandomizetemp=