www.pudn.com > 510.rar > Form1.frm
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3030
ClientLeft = 60
ClientTop = 450
ClientWidth = 4620
LinkTopic = "Form1"
ScaleHeight = 3030
ScaleWidth = 4620
StartUpPosition = 3 '窗口缺省
Begin VB.Timer Timer1
Interval = 10
Left = 2760
Top = 2640
End
Begin VB.CommandButton Command1
Caption = "输出"
Height = 495
Left = 2640
TabIndex = 3
Top = 1680
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Left = 2640
TabIndex = 2
Top = 960
Width = 1815
End
Begin VB.PictureBox Picture1
Height = 2895
Left = 120
ScaleHeight = 2835
ScaleWidth = 2355
TabIndex = 0
Top = 120
Width = 2415
End
Begin VB.Label Label1
BackColor = &H80000016&
Caption = "输入数据"
BeginProperty Font
Name = "华文行楷"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2760
TabIndex = 1
Top = 240
Width = 1695
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim n%, y%, x, s(100) As String
Dim t(100), f, g, b As Integer
Private Sub Command1_Click()
g = 1
b = 1
End Sub
Private Sub Text1_keypress(keyascii As Integer)
If keyascii = 13 Then
s(n) = Text1.Text
Text1.Text = ""
n = n + 1
End If
End Sub
Private Sub Timer1_Timer()
If f < n And g = 1 And b = 1 Then
t(f) = Asc(s(f))
f = f + 1
Else: If f = n Then f = 0
Picture1.Cls
For i = 0 To n - 1
For j = 0 To n - i - 1
If t(j) < t(j + 1) Then
x = s(j)
y = t(j)
t(j) = t(j + 1)
s(j) = s(j + 1)
s(j + 1) = x
t(j + 1) = y
End If
Next j
Next i
b = 0
For i = 0 To n
Picture1.Print s(i)
Next i
End If
End Sub