一道求绩点的题

来源:百度知道 编辑:UC知道 时间:2024/05/20 06:07:13
我想做一道题,绩点的平均分为4.1,有四门功课,每门至少3.5,绩点都是一位小数的。
求求各位大虾帮帮忙!
就是说,有四门功课其取值为3.5到5,而要使四门功课的平均值为4.1,这四门功课的分值有哪些取值,分值都是一位小数

Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer, d As Integer
Dim n As Integer
For a = 35 To 50
For b = 35 To 50
For c = 35 To 50
For d = 35 To 50
If a + b + c + d = 41 * 4 Then
Print Format(a / 10, "0.0"), Format(b / 10, "0.0"), Format(c / 10, "0.0"), Format(d / 10, "0.0")
End If
Next d
Next c
Next b
Next a

End Sub

总共2265个答案

什么意思啊?

Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer, d As Integer
For a = 35 To 41
For b = a To 50
For c = b To 50
For d = c To 50
If a + b + c + d = 41 * 4 Then
Print Format(a / 10, "0.0"), Format(b / 10, "0.0"), Format(c / 10, "0