求vb题目
展开全部
Private Sub Form_Click()
Cls
Dim A As Integer, B As Integer
Dim N As Integer
Dim I As Integer, J As Integer
A = 1200 / 5
B = 1200 / 12
For I = 0 To A
For J = 0 To B
If 5 * I + 12 * J = 1200 Then
N = N + 1
Print "第"; N; "种方案:小盒装"; I; "盒,大盒装"; J; "盒。"
End If
Next
Next
Print "共有以上"; N; "种方案。"
End Sub
已经运行过,共有21种方案。
Cls
Dim A As Integer, B As Integer
Dim N As Integer
Dim I As Integer, J As Integer
A = 1200 / 5
B = 1200 / 12
For I = 0 To A
For J = 0 To B
If 5 * I + 12 * J = 1200 Then
N = N + 1
Print "第"; N; "种方案:小盒装"; I; "盒,大盒装"; J; "盒。"
End If
Next
Next
Print "共有以上"; N; "种方案。"
End Sub
已经运行过,共有21种方案。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询