VB把一张一元钞票,换成一分,二分和五分硬币,每种至少11枚,有多少种方案
问题描述:
VB把一张一元钞票,换成一分,二分和五分硬币,每种至少11枚,有多少种方案
VB选修作业,
答
Private Sub Command1_Click()
Print " 5分"," 2分"," 1分"
For a = 11 To 20
For b = 11 To (100 - 5 * a) \ 2
c = 100 - 5 * a - 2 * b
If c >= 11 Then Print a,b,c
Next b,a
End Sub