青岛科技大学vb答案实验四(6)
发布时间:2021-06-07
发布时间:2021-06-07
1)代码设计
Private Sub Form_Click()
Dim a As Integer, b As Integer, c As Integer, d As Integer
d = 0
For a = 1 To 100
For b = 1 To (100 - a)
c = 100 - a - b
If (3 * a + 2 * b + c / 2) = 100 Then
d = d + 1
Print d; Tab; "大马" & a & "匹"; Tab; "小马" & b & "匹"; Tab; "马驹" & c & "匹" Print "************************************"
End If
Next b
Next a
Print "共有" & d & "种方法"
End Sub
2)将程序运行的结果图截下粘贴在下面。
3)调试过程记录(错误情况及改正方法)
错误 For a = 0 To 100
For b = 0 To (100 - a)
For c = 0 To (100-a-b)