Visual-Basic-实验指导书程序代码.doc

Visual-Basic-实验指导书程序代码.doc

ID:59548087

大小:40.00 KB

页数:26页

时间:2020-11-10

Visual-Basic-实验指导书程序代码.doc_第1页
Visual-Basic-实验指导书程序代码.doc_第2页
Visual-Basic-实验指导书程序代码.doc_第3页
Visual-Basic-实验指导书程序代码.doc_第4页
Visual-Basic-实验指导书程序代码.doc_第5页
资源描述:

《Visual-Basic-实验指导书程序代码.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、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(Text1.Text=""Text2.

2、Text=""Text3.Text=""EndSubPrivateSubCommand3_Click(EndEndSubPrivateSubmaxmin(a(AsInteger,maxAsInteger,minAsIntegerDimiAsIntegermax=a(1:min=a(1Fori=LBound(a+1ToUBound(aIfa(i>maxThenmax=a(iElseIfa(i

3、al(Text1.TextIfverify(xThenList1.AddItemxElseMsgBoxStr(x&"不是自守数。",vbInformationEndIfEndSubPrivateSubCommand2_Click(Text1.Text=""EndSubPrivateSubCommand3_Click(EndEndSubPrivateFunctionverify(xAsLongAsBooleanDimyAsLong,sAsIntegerverify=Falses=Len(CStr(xy=x*xIfx=Val(Righ

4、t(CStr(y,sThenverify=TrueEndIfEndFunction9-3OptionExplicitOptionBase1PrivateSubCommand1_Click(DimaAsInteger,bAsInteger,iAsIntegera=Val(Text1.Text:b=Val(Text2.TextFori=aTobIfsx(i=TrueThenList1.AddItemi8EndIfNextiIfList1.ListCount=0ThenList1.AddItem"无升序数"EndSubPrivateSu

5、bCommand2_Click(Text1.Text=""Text2.Text=""List1.ClearText1.SetFocusEndSubPrivateSubCommand3_Click(EndEndSubPrivateFunctionsx(ByValnAsIntegerAsBooleanDima(AsInteger,kAsInteger,iAsIntegerDok=k+1ReDimPreservea(ka(k=nMod10n=n10LoopUntiln<=0Fori=1ToUBound(a-1Ifa(i+1>=a(iT

6、henExitFunctionNextisx=TrueEndFunction9-4OptionExplicitPrivateSubCommand1_Click(Text1.Text=""Text2.Text=""Text3.Text=""EndSubPrivateSubCommand2_Click(EndEndSubPrivateFunctioncommon(ByValaAsInteger,ByValbAsIntegerAsIntegerDimrAsIntegerDor=aModba=bb=rLoopWhiler<>0common

7、=aEndFunctionPrivateSubOption1_Click(IndexAsIntegerDimaAsInteger,bAsIntegerDimmAsInteger,dAsIntegera=Text1b=Text2m=common(a,bIfIndex=0ThenText3=mElsed=a*b/mText3=dEndIfEndSub9-5OptionExplicitPrivateFunctionJudge(nAsIntegerAsBooleanDimiAsIntegerFori=2ToSqr(nIfnModi=0Th

8、enExitFunctionNextiJudge=TrueEndFunctionPrivateSubCommand1_Click(DimxAsInteger,iAsIntegerx=Text1.TextIfx=4ThenText2="2+2"Els

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。