-
-
Save vexorian/a8c480cd12f52d73c71b to your computer and use it in GitHub Desktop.
Problem 5
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
def five(): | |
for x in range(3**8): | |
nums = [] | |
s = '1' | |
for i in xrange(2,10): | |
d = x / (3**(i - 2)) % 3 | |
if d == 0: | |
s = s + str(i) | |
elif d == 1: | |
s = s + '+' + str(i) | |
else: | |
s = s + '-' + str(i) | |
if eval(s) == 100: | |
print s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment