资源预览内容
第1页 / 共6页
第2页 / 共6页
第3页 / 共6页
第4页 / 共6页
第5页 / 共6页
第6页 / 共6页
亲,该文档总共6页全部预览完了,如果喜欢就下载吧!
资源描述
Private Sub Command1_Click()Dim x(1 To 20) As Integer, N As IntegerFor N = 1 To 20 x(N) = Int(Rnd * 90 + 10) Text1.Text = Text1.Text & x(N) & Next NFor N = 1 To 20If x(N) = 65 And x(N) = 90 Then Text2.Text = Text2.Text & Chr(x(N) & Next NEnd SubPrivate Sub Command1_Click()Dim a As Integer, b As Integer, c As Integer, d As Integera = Val(Text1.Text)b = Val(Text2.Text)c = a - bd = a + bIf a = 0 Or b = 0 Or c = 0 Then MsgBox 请输入自然数且第一个数应该大于第二个数!, , 输入出错ElseIf Sqr(c) = Int(Sqr(c) And Sqr(d) = Int(Sqr(d) Then Text3.Text = yes Else Text3.Text = noEnd IfEnd SubPrivate Sub Command1_Click()If Len(Text1.Text) Asc(D) Then List2.AddItem N(i)Next iEnd SubPrivate Sub Command1_Click()Text2.Text = zh(Text1.Text) zh过程在原本的程序代码中已经有了,直接可用End SubPrivate Sub Command1_Click()Dim i As IntegerOpen App.Path & & Y24.txt For Input As #1For i = 1 To 20 Input #1, Arr(i)Next iClose #1Text1.Text = Y24.txt文件数据已读入End SubPrivate Sub Command2_Click()Dim s As Integer, i As Integers = 0For i = 1 To 20s = s + Arr(i)Next iText1.Text = sEnd SubOption ExplicitDim a(1 To 100) As StringPrivate Sub Command1_Click()Dim i As IntegerText1.Text = For i = 1 To 100a(i) = sczf 利用sczf过程生成随机英文字母Text1.Text = Text1.Text & a(i) & Next iEnd SubPrivate Sub Command2_Click()Dim i As IntegerDim char As String, S As Integerchar = Text2.TextIf (Asc(char) = 65 And Asc(char) = 97 And Asc(char) = 120) Then S = 0 For i = 1 To 100 If Asc(a(i) = Asc(char) Then S = S + 1 Next i Text3.Text = Str(S)Else MsgBox 统计目标非英文字母, , 重新输入 Text2.SetFocus Text2.SelStart = 0 Text2.SelLength = Len(Text2.Text)End IfEnd SubPrivate Sub Command1_Click()不得删改本行注释Dim i As IntegerOpen App.Path & & rywj.txt For Input As #1For i = 1 To 10 Input #1, Arr(i)Next iClose #1End SubPrivate Sub Command2_Click()不得删改本行注释Text1.Text = Dim i As IntegerFor i = 1 To 10If Left(Arr(i), 1) = 黄 Or Left(Arr(i), 1) = 陈 Then Text1.Text = Text1.Text & Arr(i) & End ifNext iEnd Sub
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号