📄 各门和各课平均分.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 '窗口缺省
Begin VB.CommandButton cmdCalcu
Caption = "统计"
Height = 495
Left = 1080
TabIndex = 0
Top = 2400
Width = 2175
End
Begin VB.Label Label7
Caption = "英语平均分: "
Height = 255
Left = 360
TabIndex = 7
Top = 1920
Width = 1815
End
Begin VB.Label Label6
Caption = "数学平均分: "
Height = 255
Left = 2640
TabIndex = 6
Top = 1320
Width = 1695
End
Begin VB.Label Label5
Caption = "计算机平均分: "
Height = 255
Left = 360
TabIndex = 5
Top = 1320
Width = 2055
End
Begin VB.Label Label4
Caption = "陈晓燕平均分: "
Height = 255
Left = 2520
TabIndex = 4
Top = 720
Width = 1815
End
Begin VB.Label Label3
Caption = "王晓东平均分: "
Height = 255
Left = 360
TabIndex = 3
Top = 720
Width = 1815
End
Begin VB.Label Label2
Caption = "张刚平均分: "
Height = 255
Left = 2520
TabIndex = 2
Top = 120
Width = 1815
End
Begin VB.Label Label1
Caption = "李明平均分: "
Height = 255
Left = 360
TabIndex = 1
Top = 120
Width = 1815
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim A(3, 2), B(3), C(2)
Private Sub cmdCalcu_Click()
Dim i, j As Integer
Dim Total As Single
For i = 0 To 3
Total = 0
For j = 0 To 2
Total = Total + A(i, j)
Next j
B(i) = Total / 3
Next i
For j = 0 To 2
For i = 0 To 3
C(j) = C(j) + A(i, j)
Next i
C(j) = C(j) / 4
Next j
Label1.Caption = Label1.Caption + Format(B(0))
Label2.Caption = Label2.Caption + Format(B(1))
Label3.Caption = Label3.Caption + Format(B(2))
Label4.Caption = Label4.Caption + Format(B(3))
Label5.Caption = Label5.Caption + Format(C(0))
Label6.Caption = Label6.Caption + Format(C(1))
Label7.Caption = Label7.Caption + Format(C(2))
End Sub
Private Sub Form_Load()
A(0, 0) = 82
A(0, 1) = 87
A(0, 2) = 98
A(1, 0) = 72.5
A(1, 1) = 62.5
A(1, 2) = 51
A(2, 0) = 72
A(2, 1) = 88
A(2, 2) = 84.5
A(3, 0) = 83
A(3, 1) = 52.5
A(3, 2) = 92.5
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -