📄 平均分和优秀率.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton andCalcu
Caption = "统计"
Height = 615
Left = 960
TabIndex = 0
Top = 2040
Width = 2535
End
Begin VB.Label Label2
Caption = "优秀率: "
Height = 615
Left = 1080
TabIndex = 2
Top = 1080
Width = 2295
End
Begin VB.Label Label1
Caption = "平均分: "
Height = 495
Left = 1080
TabIndex = 1
Top = 240
Width = 2295
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim A(6) As Single
Private Sub andCalcu_Click()
Dim i As Integer
Dim j As Integer
Dim Total As Single
Dim Exsell As Single
For i = 0 To 5 Step 1
Total = Total + A(i)
If A(i) >= 80 Then
j = j + 1
End If
Next i
Average = Total / 6
Exsell = j / 6 * 100
Label1.Caption = Label1.Caption + Format(Average)
Label2.Caption = Label2.Caption + Format(Exsell) + "%"
End Sub
Private Sub Form_Load()
A(0) = 82
A(1) = 76.5
A(2) = 91
A(3) = 80
A(4) = 75
A(5) = 84.8
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -