How to use Python how to exchange 100 yuan to 1 yuan, 5, 10 yuan change, how many exchange methods are there?

3 thoughts on “How to use Python how to exchange 100 yuan to 1 yuan, 5, 10 yuan change, how many exchange methods are there?”

  1. CNT = 0
    FOR I in XRANGE (100 /1 1):
    for j in xrange ((100 -i * 1) / 5 1):
    for k in xrange 100 -i * 1 j * 5) / 10 1):
    if I * 1 J * 5 K * 10 == 100:
    prop "1:", i, "5 : ", j," 10: ", k
    CNT = 1
    print cNT

    The results are as follows, a total of 121 species
    1: 0 5: 0 10: 10
    1: 0 5: 2 10: 9
    1: 0 5: 4 10: 8
    1: 0: 6 10: 7
    1: 0 5: 8 10: 6
    1: 0 5: 10: 5
    1: 0 5: 12 10: 4
    1: 0 5: 14 10: 3
    1: 0 5: 16 10: 2
    1 : 0 5: 18 10: 1
    1: 0 5: 20 10: 0
    1: 5: 1 10: 9
    1: 5: 3 10: 8
    1: 5 5: 5 10: 7
    1: 5 5: 7 10: 6
    1: 5 5: 9 10: 5
    1: 5: 11 10: 4
    1: 5 5: 13 10: 3
    1: 5 5: 15 10: 2
    1: 5 5: 17 10: 1
    1: 5: 19 10: 0
    1: 10 5: 0 10 10 : 9
    1: 10 5: 2 10: 8
    1: 10 5: 4 10: 7
    1: 10 5: 6
    1: 10 5: 8 10: 5
    1: 10 5: 10 10: 4
    1: 10 5: 12 10: 3
    1: 10 5: 14 10: 2
    1: 10 5: 16 10: 1
    1: 10 5: 18 10: 0
    1: 15 5: 10: 8
    1: 15 5: 3 10: 7
    1: 15: 5 10: 6
    1: 15: 7 10: 5
    1: 15: 9 10: 4
    1: 15 5: 11 10: 3
    1: 15: 13 10: 2
    1: 15: 15 10: 1
    1: 15: 17 10: 0
    1: 20 5: 0 10: 8
    1: 20 5: 2 10: 7
    1: 20 5: 4 10: 6
    1: 20 5: 6 10: 5
    1: 20 5: 8 10: 4
    1: 20 5: 10: 3
    1: 20 5: 12 10: 2
    1: 20 5: 14 10: 1
    1: 20 5 : 16 10: 0
    1: 25 5: 1 10: 7
    1: 25 5: 3 10: 6
    1: 25 5: 5
    1: 25 5: 7 10: 4
    1: 25 5: 9 10: 3
    1: 25 5: 11 10: 2
    1: 25 5: 13 10: 1
    1: 25 5: 15 10: 0
    1: 30 5: 0 10: 7
    1: 30 5: 2 10: 6
    1: 30 5: 4 10: 5
    1: 30 5: 6 10: 4
    1: 30 5: 8 10: 3
    1: 30 5: 10: 2
    1: 30 5: 1
    1: 30 5: 0: 0 r
    1: 35 5: 1 10: 6
    1: 35 5: 3 10: 5
    1: 35 5: 5 10: 4
    1: 35 5: 3
    1: 35 5: 9 10: 2
    1: 35 5: 11 10: 1
    1: 35 5: 13 10: 0
    1: 40 5: 6
    1: 40 5 : 2 10: 5
    1: 40 5: 4 10: 4
    1: 40 5: 6 10: 3
    1: 40 5: 8 10: 2
    1: 40 5: 10 10: 1
    1: 40 5: 12 10: 0
    1: 45 5: 5
    1: 45 5: 3 10: 4
    1: 45 5: 5 10: 3
    1: 45 5: 7 10: 2
    1: 45 5: 1
    1: 45 5: 0 r r r r r r r r r r r r r r r r r n1: 50 5: 0 10: 5
    1: 50 5: 2 10: 4
    1: 50 5: 4 10: 3
    1: 50 5: 6 10: 2
    1: 50 5: 8 10: 1
    1: 50 5: 10: 0
    1: 55 5: 1 10: 4
    1: 55 5: 3
    1: 55 5 : 5 10: 2
    1: 55 5: 7 10: 1
    1: 55 5: 9 10: 0
    1: 60 5: 0: 4
    1: 60 5: 2 10: 3
    1: 60 5: 4 10: 2
    1: 60 5: 6 10: 1
    1: 60 5: 8 10: 0
    1: 65 5: 1 10: 3
    1: 65 5: 3 10: 2
    1: 65 5: 5 10: 1
    1: 65 5: 7 10: 0
    1: 70 5: 0 10: 3
    1: 70 5: 2 10: 2
    1: 70 5: 4 10: 1
    1: 70 5: 0
    1: 75 5: 1 10: 2 r r n1: 75 5: 3 10: 1
    1: 75 5: 5 10: 0
    1: 80 5: 0 10: 2
    1: 80 5: 1
    1: 80 5: 4 10: 0
    1: 85 5: 1 10: 1
    1: 85 5: 3 10: 0
    1: 90 5: 1
    1: 90 5 : 2 10: 0
    1: 95 5: 1 10: 0
    1: 100 5: 0 10: 0
    121

  2. 1x 2y 5Z = 100
    x = 100-2y-5Z [0 u003C= y u003C= 50] [0 u003C= z u003C= 20]
    FOR y in range (51):
    for z in range (21):
    x = 100-2*y-5*z

    if x> = 0:
    n prop, y, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart
Scroll to Top