欢迎来到天天文库
浏览记录
ID:48439071
大小:49.00 KB
页数:26页
时间:2020-01-28
《Visual_Basic_实验指导书程序代码(精).doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、.word可编辑.9-1OptionExplicitOptionBase1PrivateSubCommand1_Click(Dimx(10AsInteger,maxvAsInteger,minvAsIntegerDimiAsIntegerFori=1To10x(i=Int(90*Rnd+10Text1.Text=Text1&Str(x(iNextiCallmaxmin(x,maxv,minvText2.Text=maxvText3.Text=minvEndSubPrivateSubCommand2_Click(Tex
2、t1.Text=""Text2.Text=""Text3.Text=""EndSub.专业.专注..word可编辑.PrivateSubCommand3_Click(EndEndSubPrivateSubmaxmin(a(AsInteger,maxAsInteger,minAsIntegerDimiAsIntegermax=a(1:min=a(1Fori=LBound(a+1ToUBound(aIfa(i>maxThenmax=a(iElseIfa(i3、2PrivateSubCommand1_Click(DimxAsLongx=Val(Text1.TextIfverify(xThen.专业.专注..word可编辑.List1.AddItemxElseMsgBoxStr(x&"不是自守数。",vbInformationEndIfEndSubPrivateSubCommand2_Click(Text1.Text=""EndSubPrivateSubCommand3_Click(EndEndSubPrivateFunctionverify(xAsLongAsBoolean4、DimyAsLong,sAsIntegerverify=Falses=Len(CStr(xy=x*xIfx=Val(Right(CStr(y,sThenverify=TrueEndIfEndFunction.专业.专注..word可编辑.9-3OptionExplicitOptionBase1PrivateSubCommand1_Click(DimaAsInteger,bAsInteger,iAsIntegera=Val(Text1.Text:b=Val(Text2.TextFori=aTobIfsx(i=TrueT5、henList1.AddItemi8EndIfNextiIfList1.ListCount=0ThenList1.AddItem"无升序数"EndSubPrivateSubCommand2_Click(Text1.Text=""Text2.Text=""List1.ClearText1.SetFocusEndSub.专业.专注..word可编辑.PrivateSubCommand3_Click(EndEndSubPrivateFunctionsx(ByValnAsIntegerAsBooleanDima(AsInte6、ger,kAsInteger,iAsIntegerDok=k+1ReDimPreservea(ka(k=nMod10n=n10LoopUntiln<=0Fori=1ToUBound(a-1Ifa(i+1>=a(iThenExitFunctionNextisx=TrueEndFunction9-4OptionExplicitPrivateSubCommand1_Click(.专业.专注..word可编辑.Text1.Text=""Text2.Text=""Text3.Text=""EndSubPrivateSubCo7、mmand2_Click(EndEndSubPrivateFunctioncommon(ByValaAsInteger,ByValbAsIntegerAsIntegerDimrAsIntegerDor=aModba=bb=rLoopWhiler<>0common=aEndFunctionPrivateSubOption1_Click(IndexAsIntegerDimaAsInteger,bAsIntegerDimmAsInteger,dAsInteger.专业.专注..word可编辑.a=Text1b=Text2m8、=common(a,bIfIndex=0ThenText3=mElsed=a*b/mText3=dEndIfEndSub9-5OptionExplicitPrivateFunctionJudge(nAsIntegerAsBooleanDimiAsIntegerFori=2ToSqr(nIfnModi=0ThenExitFunctionNexti
3、2PrivateSubCommand1_Click(DimxAsLongx=Val(Text1.TextIfverify(xThen.专业.专注..word可编辑.List1.AddItemxElseMsgBoxStr(x&"不是自守数。",vbInformationEndIfEndSubPrivateSubCommand2_Click(Text1.Text=""EndSubPrivateSubCommand3_Click(EndEndSubPrivateFunctionverify(xAsLongAsBoolean
4、DimyAsLong,sAsIntegerverify=Falses=Len(CStr(xy=x*xIfx=Val(Right(CStr(y,sThenverify=TrueEndIfEndFunction.专业.专注..word可编辑.9-3OptionExplicitOptionBase1PrivateSubCommand1_Click(DimaAsInteger,bAsInteger,iAsIntegera=Val(Text1.Text:b=Val(Text2.TextFori=aTobIfsx(i=TrueT
5、henList1.AddItemi8EndIfNextiIfList1.ListCount=0ThenList1.AddItem"无升序数"EndSubPrivateSubCommand2_Click(Text1.Text=""Text2.Text=""List1.ClearText1.SetFocusEndSub.专业.专注..word可编辑.PrivateSubCommand3_Click(EndEndSubPrivateFunctionsx(ByValnAsIntegerAsBooleanDima(AsInte
6、ger,kAsInteger,iAsIntegerDok=k+1ReDimPreservea(ka(k=nMod10n=n10LoopUntiln<=0Fori=1ToUBound(a-1Ifa(i+1>=a(iThenExitFunctionNextisx=TrueEndFunction9-4OptionExplicitPrivateSubCommand1_Click(.专业.专注..word可编辑.Text1.Text=""Text2.Text=""Text3.Text=""EndSubPrivateSubCo
7、mmand2_Click(EndEndSubPrivateFunctioncommon(ByValaAsInteger,ByValbAsIntegerAsIntegerDimrAsIntegerDor=aModba=bb=rLoopWhiler<>0common=aEndFunctionPrivateSubOption1_Click(IndexAsIntegerDimaAsInteger,bAsIntegerDimmAsInteger,dAsInteger.专业.专注..word可编辑.a=Text1b=Text2m
8、=common(a,bIfIndex=0ThenText3=mElsed=a*b/mText3=dEndIfEndSub9-5OptionExplicitPrivateFunctionJudge(nAsIntegerAsBooleanDimiAsIntegerFori=2ToSqr(nIfnModi=0ThenExitFunctionNexti
此文档下载收益归作者所有