vb题。 编一个成绩统计的程序。给100分 给我
展开全部
Dim cj() As Integer
Dim n As Integer
Private Sub Command1_Click()
Dim i%, p%, jg%, bjg%
For i = 1 To n
If cj(i) >= 60 Then jg = jg + 1
If cj(i) < 60 Then bjg = bjg + 1
p = p + cj(i)
Next
Text1 = jg
Text2 = bjg
Text3 = Int(p / n)
End Sub
Private Sub Command2_Click()
On Error Resume Next
Dim i%, j%, t%
Print "成绩从高到低排序:"
For i = 1 To n
For j = i + 1 To n
If cj(i) < cj(j) Then
t = cj(i)
cj(i) = cj(j)
cj(j) = t
End If
Next
Next
For i = 1 To n Step 4
Print cj(i), cj(i + 1), cj(i + 2), cj(i + 3)
Next
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
Dim i%, j%
b:
n = InputBox("请输入人数:")
If n = 0 Then MsgBox "请重新输入掘穗!": GoTo b
ReDim cj(n) As Integer
For i = 1 To n
cj(i) = InputBox("请输入第" + Str(i) + "个学生困李成绩"汪散迟)
Next
End Sub
Dim n As Integer
Private Sub Command1_Click()
Dim i%, p%, jg%, bjg%
For i = 1 To n
If cj(i) >= 60 Then jg = jg + 1
If cj(i) < 60 Then bjg = bjg + 1
p = p + cj(i)
Next
Text1 = jg
Text2 = bjg
Text3 = Int(p / n)
End Sub
Private Sub Command2_Click()
On Error Resume Next
Dim i%, j%, t%
Print "成绩从高到低排序:"
For i = 1 To n
For j = i + 1 To n
If cj(i) < cj(j) Then
t = cj(i)
cj(i) = cj(j)
cj(j) = t
End If
Next
Next
For i = 1 To n Step 4
Print cj(i), cj(i + 1), cj(i + 2), cj(i + 3)
Next
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
Dim i%, j%
b:
n = InputBox("请输入人数:")
If n = 0 Then MsgBox "请重新输入掘穗!": GoTo b
ReDim cj(n) As Integer
For i = 1 To n
cj(i) = InputBox("请输入第" + Str(i) + "个学生困李成绩"汪散迟)
Next
End Sub
更多追问追答
追问
源文件有吗
追答
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
兄弟,只能帮你到这里了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询