用vb计算1-1 2 1 3-1 4 ... 1 100的值.
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 17:40:32
PrivateSubCommand1_Click()DimsumAsDoubleDimiAsLongDimnAsDoublen=((1/(10^-5))+1)/2'正好等于10^-5时候n的值
Private Sub Command1_Click() Dim i As Integer &
OptionExplicitPrivateSubCommand1_Click()Label1.Visible=TrueDimrAs__single___Dim____s___AsDouble_cons
在命令按钮里加上以下代码:DimiAsInteger,kAsInteger,jAsIntegerDimxAsStringj=0Fori=1To35Fork=1To35If(i*3+k*4)=100Th
4个text1-text4,Label1(0-3).PrivateSubCommand1_Click()Dimk1AsSingle,k2AsSingle,k3AsSingle,k4AsSinglek1
PrivateSubCommand1_Click()Dima,xAsSinglea=Val(Text1.Text)Ifa再问:x=x+a*0.2+3000*0.2怎么都乘0.2呀?
把变量的取值范围贴出来.再问:求公式p=v*Z*F(s,x,y)/I。其他的一样求,其中F(s,x,y)=π/M,M=ln[2ch(πs/2y)]+ln{[shπ(x/y-s/2y)*shπ(x/y+
Dim I As Integer, N As Integer &nbs
阶乘n!=n*(n-1)(n-2)(n-2)···3*2*1
PrivateSubCommand1_Click()DimsAsString,nAsInteger,iAsIntegerFori=1To100n=n+iNextiPrint"1+2+3+……+100=
话说楼上的已经很好了,还要在做什么?算了,给你个实例吧,添加一个command按钮,输入以下代码OptionExplicitPrivateSubCommand1_Click()DimresultAsL
不好意思我好久没用vb了大概如下dimcassingledimxassinglex=inputbox("输入x")c=5*(x-32)/9printc\我以前把vb删了不能试你试试吧
s=1fori=1to10s=s*inextmsgboxs
PrivateSubCommand1_Click()DimnAsInteger,iAsInteger,jAsInteger,Sum&,m&n=Val(InputBox("请输入N值"))Sum=0Fo
PrivateSubCommand2_Click()DimIAsLong,SAsLongForI=1To100IfIMod2=0ThenS=S-IElseS=S+IEndIfNextPrintSEnd
PrivateSubCommand1_Click()DimiAsIntegerFori=1To10Sum=Sum+jc(i)NextMsgBoxSumEndSubFunctionjc(aAsInteg
PrivateSubCommand1_Click()Dimi,j,tDimsumsum=1Fori=2To10t=1Forj=1Toit=t*2Nextjsum=sum+tNextiPrintsumE
PrivateSubCommand1_Click()Dimi%DimsAsSingles=0Fori=1To10s=s+1/compu(i)NextiText1.Text=sEndSubFunctio
Functionfactorial(nAsInteger)AsLongDimiAsIntegerDimretAsLongret=1Fori=1Tonret=ret*iNextifactorial=re
用while的,其它的dowhile的基本相同PrivateSubCommand1_Click()DimnAsIntegern=InputBox("请输入")f=1i=2s=0Wh