123vb.docx
- 文档编号:7674903
- 上传时间:2023-01-25
- 格式:DOCX
- 页数:26
- 大小:20.01KB
123vb.docx
《123vb.docx》由会员分享,可在线阅读,更多相关《123vb.docx(26页珍藏版)》请在冰豆网上搜索。
123vb
第十套
二、
(1)PrivateSubC1_Click()
Fori=0To2
IfOp1(i).Value=TrueThen
Print"我是"+Op1(i).Caption
EndIf
Next
EndSub
(2)1)IfVal(Text1.Text)=0Then
2)Timer1.Enabled=False
3)Text1.SetFocus
三、OpenApp.Path&"\in5.txt"ForRandomAs#1Len=Len(pal)
Fori=1To5
Get#1,i,pal
Text1.Text=Text1.Text&pal.Name
Text1.Text=Text1.Text&pal.Tel
Text1.Text=Text1.Text&Str(pal.Post)
Text1.Text=Text1.Text+vbCrLf
Next
Close1
第二十八套
二、
(1)
1)List1.AddItemText1.Text
2)Fori=0ToList1.ListCount–1
3)IfList1.List(i)=Text1.TextThen
4)List1.RemoveItemi
(2)
1)Start=LBound(a)
2)Finish=UBound(a)
3)Min=a(Start)
4)Sum=0
5)Sum=Sum+a(i)
6)Average=Sum/Finish
7)Aver=Average(arr2())
三、DimSumAsInteger
PrivateSubRead_Click()
ReadData
EndSub
PrivateSubCalc_Click()
DimSAsString
Sum=0
Fori=1To100
IfInt(Arr(i)/3)=Arr(i)/3Then
Sum=Sum+Arr(i)
S=S&Str(Arr(i))&""
EndIf
Nexti
Text1.Text=S
Print"Sum=";Sum
EndSub
PrivateSubSave_Click()
WriteData"DataOut.txt",Sum
EndSub
第三十三套
二、
(1)PrivateSubCommand2_Click()
Max=a
(1)
Min=a
(1)
Fori=2To100
Ifisnarc(a(i))=TrueThen
Ifa(i)>MaxThenMax=a(i)
Ifa(i) EndIf Next Text1.Text=Max Text2.Text=Min EndSub (2)PrivateSubC1_Click() DimnAsInteger,kAsInteger,sAsLong n=Val(Cb1.Text) s=0 Fork=nTo5000 Ifk/n=Int(k/n)Then s=s+k EndIf Nextk Text1.Text=s EndSub 三、1)Ifwhich=1Then 2)ElseIfwhich=2Then 3)Text1.Text=Text1+Text3.Text 4)Text2.Text=Text2+Text3.Text 第三十七套 二、 (1)1)arrN(i)=Int(Rnd*1000) 2)Min=arrN (1) 3)IfarrN(i) (2)FunctionFun() Fori=0To1000 IfiMod7<>0Then Y=Y+1 EndIf Nexti Fun=Y EndFunction PrivateSubCommand1_Click() d=Fun() Text1.Text=d SaveData EndSub 三、PrivateSubC1_Click() ReadData1 ReadData2 EndSub PrivateSubC2_Click() DimArr3(20)AsInteger DimSumAsInteger Sum=0 Fori=1To20 Arr3(i)=Arr1(i)-Arr2(i) Sum=Sum+Arr3(i) Nexti Print"Sum=taout.txt",Sum EndSub 第三十八套 二、 (1)1)arrN(i)=Int(Rnd*1000) 2)Sum=0 3)Sum=Sum+arrN(i) 4)Aver=Sum/20 (2)FunctionFun() Sum=0 Fori=0To200 IfiMod3=0Then Sum=Sum+i EndIf Nexti Fun=Sum EndFunction 三、PrivateSubCommand2_Click() Fori=1To12 Sum=a(i,1) Forj=2To10 Sum=Sum+a(i,j) Nextj s(i)=Int(Sum/10) Nexti EndSub 第四十三套 二、 (1)PrivateSubOption1_Click() Text1.Alignment=0 EndSub PrivateSubOption2_Click() Text1.Alignment=2 EndSub PrivateSubOption3_Click() Text1.Alignment=1 EndSub PrivateSubOption4_Click() Text1.FontName="宋体" EndSub PrivateSubOption5_Click() Text1.FontName="黑体" EndSub (2)PrivateSubCommand2_Click() Timer1.Enabled=False EndSub 1)Fork=0To359Step360/12 2)x=radius*Cos(k*3.14159/180)+x0 3)Line1.Y2=y0-len1*Sin(a*3.14159/180) 4)b=b-30/12 三、1)s=a(n,1) 2)Fork=2To7 3)getmark=s*3*a(n,8) PrivateSubCommand2_Click() DimkAsInteger maxmark=getmark (1) m=1 Fork=2To5 Ifmaxmark maxmark=getmark(k) m=k EndIf Nextk Text2=athlete(m) Text3=maxmark EndSub 第四十七套 二、 (1)1)Timer1.Enabled=True 2)IfShape1.Top<=Line1.Y1Then 3)IfShape1.Top+Shape1.Height>=Line2.Y1Then (2)Functioneven() DimsAsSingle,nAsInteger s=0 Fork=1To100 Ifa(k)/2=Fix(a(k)/2)Then s=s+a(k) n=n+1 EndIf Next s=s/n even=CInt(s) EndFunction Functionodd() DimsAsSingle,nAsInteger s=0 Fork=1To100 Ifa(k)/2<>Fix(a(k)/2)Then s=s+a(k) n=n+1 EndIf Next s=s/n odd=CInt(s) EndFunction Functionall() DimsAsSingle,nAsInteger s=0 Fork=1To100 s=s+a(k) Next s=s/100 all=CInt(s) EndFunction PrivateSubCommand2_Click() SelectCaseCombo1.ListIndex Case0 Text1=even() Case1 Text1=odd() Case2 Text1=all() EndSelect EndSub 三、1)DimMat(M,N)AsInteger 2)OpenApp.Path&"\"&"datain.txt"ForInputAs#1 3)Input#1,Mat%(i,j) 4)Mat%(i,4)=t 第四十八套 二、 (1)PrivateSubC1_Click(IndexAsInteger) SelectCaseIndex Case1 Timer1.Enabled=False Case0 Timer1.Enabled=True EndSelect EndSub PrivateSubTimer1_Timer() Text1.Text=Text1.Text+1 EndSub (2)1)SelectCases 2)CaseIs<=4 3)f=10+(s-4)*1.2 4)CaseElse 5)f=10+(15-4)*1.2+(s-15)*1.8 三、PrivateSubCommand2_Click() Dima(26)AsInteger n=Len(s) Fori=1Ton c=UCase(Mid(s,i,1)) Ifc>="A"Andc<="Z"Then j=Asc(c)-Asc("A")+1 a(j)=a(j)+1 EndIf Nexti Max=a (1) t=Chr(Asc("A")) Fori=2To26 Ifa(i)>MaxThen Max=a(i) t=Chr(Asc("A")+i-1) EndIf Nexti Text1.Text=t Text2.Text=Max EndSub 第四十九套 二、 (1)1)tmp=1 2)tmp=tmp*i 3)xn=tmp 4)z=z+xn(t) (2)1)arr=Array("第一项","第二项","第三项","第四项") 2)StaticiAsInteger 3)i=0 三、PrivateSubCommand2_Click() Dimi%,j%,temp%,flagAsBoolean i=0 j=9 temp=Text1(j) flag=True While(i IfflagThen IfText1(i)Mod2=0Then Text1(j)=Text1(i) j=j-1 flag=Notflag Else i=i+1 EndIf Else IfText1(j)Mod2=1Then Text1(i)=Text1(j) i=i+1 flag=Notflag Else j=j-1 EndIf EndIf Wend Text1(i)=temp EndSub 第五十套 二、 (1)PrivateSubC1_Click() DimaAsString a="我是" IfOp1.ValueThen Text1.Text=a&Op1.Caption Else Text1.Text=a&Op2.Caption EndIf a="我的爱好是" IfCh1.Value=1Then Text2.Text=a&Ch1.Caption a=Text2.Text EndIf IfCh2.Value=1Then Text2.Text=a&Ch2.Caption EndIf EndSub (2)1)i=0 2)Timer1.Interval=1000 3)Label1.Caption=List1.List(i) 三、OptionBase1 Dimsum(6)AsInteger PrivateSubCommand1_Click() OpenApp.Path&"\in5.txt"ForInputAs#1 Text1.Text=Input(LOF (1),#1) Close#1 EndSub PrivateSubCommand2_Click() Fori=1To6 sum(i)=0 Nexti IfLen(Text1.Text)=0Then MsgBox"请先使用“读数”功能! " Else Fori=1ToLen(Text1.Text) c=LCase(Mid(Text1.Text,i,1)) SelectCasec Case"i" sum (1)=sum (1)+1 Case"j" sum (2)=sum (2)+1 Case"k" sum(3)=sum(3)+1 Case"l" sum(4)=sum(4)+1 Case"m" sum(5)=sum(5)+1 Case"n" sum(6)=sum(6)+1 EndSelect Nexti EndIf EndSub PrivateSubCommand3_Click() OpenApp.Path&"\out5.txt"ForOutputAs#1 Fori=1To6 Print#1,sum(i) Nexti Close#1 EndSub 第五十一套 二、 (1)PrivateSubC1_Click() DimA$,B$,k%,n% A$="" n%=Asc("a")-Asc("A") Fork%=1ToLen(Text1.Text) B$=Mid(Text1.Text,k%,1) IfB$>="a"AndB$<="z"Then B$=String(1,Asc(B$)-n%) Else IfB$>="A"AndB$<="Z"Then B$=String(1,Asc(B$)+32) EndIf EndIf A$=A$+B$ Nextk% Text1.Text=A EndSub
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 123 vb
![提示](https://static.bdocx.com/images/bang_tan.gif)