Created
June 28, 2021 18:34
-
-
Save tthtlc/7c3ded5ade015f3719a078c100c8fef8 to your computer and use it in GitHub Desktop.
Project Euler problem 31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
count=0 | |
for onep in range(201): | |
for twop in range(101): | |
for fivep in range(41): | |
for tenp in range(21): | |
for twentyp in range(11): | |
for fiftyp in range(5): | |
for apound in range(2): | |
for twopound in range(2): | |
sum=onep+twop*2+fivep*5+tenp*10+twentyp*20+fiftyp*50+apound*100+twopound*200 | |
if (sum==200): | |
count += 1 | |
print(onep, twop, fivep, tenp, twentyp, fiftyp, apound, twopound, count) | |
print("total ways", count) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment