VERSION 5.00
Begin VB.Form Frmfshtj 
   BackColor       =   &H00FFC0C0&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "比赛打分"
   ClientHeight    =   2955
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   9375
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2955
   ScaleWidth      =   9375
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame2 
      BackColor       =   &H00FFC0C0&
      Caption         =   "排序列表"
      Height          =   2775
      Left            =   7320
      TabIndex        =   32
      Top             =   120
      Width           =   1935
      Begin VB.PictureBox Pic1 
         BackColor       =   &H00FFC0FF&
         Height          =   2415
         Left            =   120
         ScaleHeight     =   2355
         ScaleWidth      =   1635
         TabIndex        =   33
         Top             =   240
         Width           =   1695
      End
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00FFC0C0&
      Caption         =   "运动员分数统计"
      Height          =   2775
      Left            =   3480
      TabIndex        =   21
      Top             =   120
      Width           =   3735
      Begin VB.CommandButton Cmddg 
         BackColor       =   &H00FFC0FF&
         Caption         =   "从小到大排序"
         Height          =   375
         Left            =   1920
         Style           =   1  'Graphical
         TabIndex        =   29
         Top             =   2280
         Width           =   1695
      End
      Begin VB.CommandButton Cmdgd 
         BackColor       =   &H00FFC0FF&
         Caption         =   "从大到小排序"
         Height          =   375
         Left            =   120
         Style           =   1  'Graphical
         TabIndex        =   28
         Top             =   2280
         Width           =   1695
      End
      Begin VB.CommandButton Cmdzdf 
         BackColor       =   &H00FFFFC0&
         Caption         =   "裁判打出的最低分"
         Height          =   375
         Left            =   120
         Style           =   1  'Graphical
         TabIndex        =   27
         Top             =   1800
         Width           =   1695
      End
      Begin VB.CommandButton Cmdzgf 
         BackColor       =   &H00C0C0FF&
         Caption         =   "裁判打出的最高分"
         Height          =   375
         Left            =   120
         Style           =   1  'Graphical
         TabIndex        =   26
         Top             =   1320
         Width           =   1695
      End
      Begin VB.CommandButton Cmdpj 
         BackColor       =   &H00C0E0FF&
         Caption         =   "运动员得分"
         Height          =   375
         Left            =   120
         Style           =   1  'Graphical
         TabIndex        =   23
         Top             =   840
         Width           =   1695
      End
      Begin VB.CommandButton CmdSum 
         BackColor       =   &H00C0FFFF&
         Caption         =   "裁判打出的总分"
         Height          =   375
         Left            =   120
         Style           =   1  'Graphical
         TabIndex        =   22
         Top             =   360
         Width           =   1695
      End
      Begin VB.Label Lbl4 
         Alignment       =   2  'Center
         BackColor       =   &H00FFFFC0&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1920
         TabIndex        =   31
         Top             =   1800
         Width           =   1695
      End
      Begin VB.Label Lbl3 
         Alignment       =   2  'Center
         BackColor       =   &H00C0C0FF&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1920
         TabIndex        =   30
         Top             =   1320
         Width           =   1695
      End
      Begin VB.Label Lbl2 
         Alignment       =   2  'Center
         BackColor       =   &H00C0E0FF&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1920
         TabIndex        =   25
         Top             =   840
         Width           =   1695
      End
      Begin VB.Label Lbl1 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFFF&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1920
         TabIndex        =   24
         Top             =   360
         Width           =   1695
      End
   End
   Begin VB.Frame Fradafen 
      BackColor       =   &H00FFC0C0&
      Caption         =   "为运动员打分"
      Height          =   2775
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   3255
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFC0&
         Height          =   270
         Index           =   10
         Left            =   2520
         TabIndex        =   34
         Text            =   "Text1"
         Top             =   1800
         Width           =   615
      End
      Begin VB.CommandButton Cmdqch 
         BackColor       =   &H00C0FFC0&
         Caption         =   "清除"
         Height          =   375
         Left            =   1800
         Style           =   1  'Graphical
         TabIndex        =   18
         Top             =   2280
         Width           =   1335
      End
      Begin VB.CommandButton Cmdmndf 
         BackColor       =   &H00C0FFC0&
         Caption         =   "模拟打分"
         Height          =   375
         Left            =   240
         Style           =   1  'Graphical
         TabIndex        =   17
         Top             =   2280
         Width           =   1335
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFC0&
         Height          =   270
         Index           =   9
         Left            =   2520
         TabIndex        =   9
         Text            =   "Text1"
         Top             =   1440
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFC0&
         Height          =   270
         Index           =   8
         Left            =   2520
         TabIndex        =   8
         Text            =   "Text1"
         Top             =   1080
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFC0&
         Height          =   270
         Index           =   7
         Left            =   2520
         TabIndex        =   7
         Text            =   "Text1"
         Top             =   720
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFC0&
         Height          =   270
         Index           =   6
         Left            =   2520
         TabIndex        =   6
         Text            =   "Text1"
         Top             =   360
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFC0&
         Height          =   270
         Index           =   5
         Left            =   840
         TabIndex        =   5
         Text            =   "Text1"
         Top             =   1800
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFC0&
         Height          =   270
         Index           =   4
         Left            =   840
         TabIndex        =   4
         Text            =   "Text1"
         Top             =   1440
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFC0&
         Height          =   270
         Index           =   3
         Left            =   840
         TabIndex        =   3
         Text            =   "Text1"
         Top             =   1080
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFC0&
         Height          =   270
         Index           =   2
         Left            =   840
         TabIndex        =   2
         Text            =   "Text1"
         Top             =   720
         Width           =   615
      End
      Begin VB.TextBox Text 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFC0&
         Height          =   270
         Index           =   1
         Left            =   840
         TabIndex        =   1
         Text            =   "Text1"
         Top             =   360
         Width           =   615
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "Label1"
         Height          =   255
         Index           =   10
         Left            =   1800
         TabIndex        =   35
         Top             =   1800
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "Label1"
         Height          =   255
         Index           =   9
         Left            =   1800
         TabIndex        =   20
         Top             =   1440
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "Label1"
         Height          =   255
         Index           =   7
         Left            =   1800
         TabIndex        =   19
         Top             =   720
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "Label1"
         Height          =   255
         Index           =   8
         Left            =   1800
         TabIndex        =   16
         Top             =   1080
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "Label1"
         Height          =   255
         Index           =   6
         Left            =   1800
         TabIndex        =   15
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "Label1"
         Height          =   255
         Index           =   5
         Left            =   120
         TabIndex        =   14
         Top             =   1800
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "Label1"
         Height          =   255
         Index           =   4
         Left            =   120
         TabIndex        =   13
         Top             =   1440
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "Label1"
         Height          =   255
         Index           =   3
         Left            =   120
         TabIndex        =   12
         Top             =   1080
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "Label1"
         Height          =   255
         Index           =   2
         Left            =   120
         TabIndex        =   11
         Top             =   720
         Width           =   735
      End
      Begin VB.Label Lbl 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "Label1"
         Height          =   255
         Index           =   1
         Left            =   120
         TabIndex        =   10
         Top             =   360
         Width           =   735
      End
   End
End
Attribute VB_Name = "Frmfshtj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Sum As Single       '定义存放总分的变量
Rem 初始化程序
Private Sub Form_Load()
  For i = 1 To 10
    Lbl(i).Caption = "裁判" + CStr(i)   '为裁判编号的控件数组设置标识属性
    Text(i).Text = 0           '裁判打出分数的控件数组设置文本属性
  Next i
End Sub
Rem 模拟打分
Private Sub Cmdmndf_Click()
  Dim r As Single
  Randomize               '随机数序列初始化
  For i = 1 To 10
    r = Rnd * 2 + 8       '产生(8,10)之间的随机小数
    Text(i).Text = Fix(r * 100 + 0.5) / 100  '按四舍五入保留小数点后两位小数
  Next i
End Sub
Rem 求总分
Private Sub CmdSum_Click()
  Sum = 0
  For i = 1 To 10
    Sum = Sum + Text(i).Text   '累加总分
  Next i
  Lbl1.Caption = Fix(Sum * 100 + 0.5) / 100    '按四舍五入保留小数点后两位小数
End Sub
Rem 求运动员得分
Private Sub Cmdpj_Click()
  Dim Max As Single, Min As Single
  Dim k As Single                         '定义文本框中数值的暂存变量
  Dim Av As Single
  k = Val(Text(1).Text)
  Min = k: Max = k: Sum = k
  For i = 2 To 10
    k = Val(Text(i).Text)
    If Max < k Then        '如果文本框中的数据大于Max中的数据则
        Max = k            '把文本框中的数据赋值给Max
    End If                 '判断结束
    If Min > k Then        '如果文本框中的数据大于Min中的数据则
        Min = k            '把文本框中的数据赋值给Min
    End If                 '判断结束
    Sum = Sum + Text(i).Text
  Next i
  Sum = Sum - Min - Max
  Av = Sum / 8
  Lbl2.Caption = Fix(Av * 100 + 0.5) / 100
End Sub
Rem 清除
Private Sub Cmdqch_Click()
  For i = 1 To 10
    Text(i).Text = 0
  Next i
  Lbl1.Caption = ""
  Lbl2.Caption = ""
  Lbl3.Caption = ""
  Lbl4.Caption = ""
  Pic1.Cls
End Sub
Rem 求最大值
Private Sub Cmdzgf_Click()
   Dim Max As Single        '定义存放较大值的变量
   Dim k As Single          '定义文本框中数值的暂存变量
   Max = 0                  '为变量Max设置一个较小的初值
   For i = 1 To 10
     k = Val(Text(i).Text)  '把文本框中的数据暂存于变量k中
     If Max < k Then        '如果文本框中的数据大于Max中的数据则
        Max = k             '把文本框中的数据赋值给Max
     End If                 '判断结束
   Next i
   Lbl3.Caption = Max       '在标签框输出Max中的最大值
End Sub
Rem 求最小值
Private Sub Cmdzdf_Click()
   Dim Min As Single        '定义存放较大值的变量
   Dim k As Single          '定义文本框中数值的暂存变量
   Min = 100                '为变量Min设置一个较小的初值
   For i = 1 To 10
     k = Val(Text(i).Text)  '把文本框中的数据暂存于变量k中
     If Min > k Then        '如果文本框中的数据大于Min中的数据则
        Min = k             '把文本框中的数据赋值给Min
     End If                 '判断结束
   Next i
   Lbl4.Caption = Min       '在标签框输出Min中的最大值
End Sub
Rem 从大到小排序
Private Sub Cmdgd_Click()
   Dim a(1 To 10) As Single '定义存放分数的数组
   Dim b(1 To 10) As Single '定义裁判序号的数组
   Dim t1!, t2!
   For i = 1 To 10
     a(i) = Val(Text(i).Text)
     b(i) = i
   Next i
   For i = 1 To 9
     For j = i + 1 To 10
       If a(i) < a(j) Then
         t1 = a(i): a(i) = a(j): a(j) = t1
         t2 = b(i): b(i) = b(j): b(j) = t2
       End If
     Next j
   Next i
   Pic1.Cls
   Pic1.Print "裁判序号"; Tab(11); "成绩排序"
   Pic1.Print "－－－－－－－－－－－－"
   For i = 1 To 10
     Pic1.Print " 裁判" + CStr(b(i)); Tab(12); a(i)
   Next i
End Sub
Rem 从小到大排序
Private Sub Cmddg_Click()
   Dim a(1 To 10) As Single '定义存放分数的数组
   Dim b(1 To 10) As Single '定义裁判序号的数组
   Dim t1!, t2!
   For i = 1 To 10
     a(i) = Val(Text(i).Text)
     b(i) = i
   Next i
   For i = 1 To 9
     For j = i + 1 To 10
       If a(i) > a(j) Then
         t1 = a(i): a(i) = a(j): a(j) = t1
         t2 = b(i): b(i) = b(j): b(j) = t2
       End If
     Next j
   Next i
   Pic1.Cls
   Pic1.Print "裁判序号"; Tab(11); "成绩排序"
   Pic1.Print "－－－－－－－－－－－－"
   For i = 1 To 10
     Pic1.Print " 裁判" + CStr(b(i)); Tab(12); a(i)
   Next i
End Sub

