SHARE
TWEET

Untitled

a guest Apr 18th, 2019 26 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for i in range(3**8):
  2.     expr = '1'
  3.     for j in range(1,9):
  4.         op = int(i/(3**(j-1)))%3 # i 3-as szamrendszerbeli alakjanak j-edik helyierteke
  5.         if op == 1:
  6.             expr += '+'
  7.         elif op == 2:
  8.             expr += '-'
  9.         expr += str(j+1)
  10.     if eval(expr) == 100:
  11.         print(expr + '=100')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top