文件名称:vb字母输出代码
文件大小:52KB
文件格式:EXE
更新时间:2015-11-08 16:12:34
字母选区
随即产生字母并统计 Private Sub Command1_Click() Dim i As Integer, j As Integer, k As Integer, n As Integer Dim R As String, S As String, T As String, d1, d2 As String Randomize i = Int(Rnd * (30 + 1 - 10) + 10) For j = 1 To i R = R & Chr(Int(Rnd * 26) + 65) Next Print "随机产生" & i & "个字母:" & R Print "两两之间升序的有:" For k = 1 To Len(R) - 1 d1 = Right(R, 1) d2 = Left(R, 1) S = Mid(R, k, 1) T = Mid(R, k + 1, 1) If Asc(T) > Asc(S) Then n = n + 1 Print Spc(6); S; T Print Spc(10); "第" & n & "组升序的" End If Next If Asc(d1) > Asc(d2) Then n = n + 1 Print Spc(6); d1; d2 Print Spc(20); "共" & n & "组升序的" End If End Sub