1.打印有规律图形PrivateSubForm_Click()Fori=1To9PrintTab(20-i);String(2*i-1,Trim(Str(i)))NextiPrintTab(10);String(19,Right(Str(i),1))EndSub2.近似计算pi的值;PrivateSubCommand1_Click()n=Text1pi=2Fori=1Tona=(2*i)*(2*i)/((2*i-1)*(2*i+1))pi=pi*aNextiText2=piEndSub3.显示图形PrivateSubPicture1_Click()DimseAsStringFori=1To6s=0Forj=1Tois=10*s+jIfiMod2=0Thense=-&sPicture1.PrintTab(j*9+1);se;Else:se=sPicture1.PrintTab((j)*9+2);se;EndIfNextjPicture1.PrintNextiEndSub4.显示水仙花数,三位数的PrivateSubForm_Click()Fors=100To999a=s\100b=(s-100*a)\10c=s-100*a-10*bIfs=a*a*a+b*b*b+c*c*cThenPrintsEndIfNextsEndSub5.求sn=a+aa+aaa……+aaaa(n个a)a是1到9的随机数,n是5到10的随机数PrivateSubCommand1_Click()m=Int(Rnd*9+1)n=Int(Rnd*6+5)temp=0s=0Fori=1Tontemp=temp*10+ms=s+tempNextiPrintsPrintmPrintnEndSub6.规范文字句子开头大写,其他都小写,句子结束符号位“.”“!”“?”OptionExplicitPrivateSubCommand1_Click()DimTAsString,i,SAsString,zfAsStringDimOutPutAsStringT=.zf=Trim(Text1.Text)Fori=1ToLen(zf)S=Mid(zf,i,1)OutPut=OutPut&IIf(InStr(?.!?。!“”&Chr(34),T)0,UCase(S),LCase(S))IfInStr(Chr(13)&Chr(10)&,S)=0ThenT=SNextText1.Text=OutPutEndSub原来的规范后的