repl.it
@rayhu007/

power3

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import time
start=time.time()

for a in range(1,100):
  a3=a**3
  for b in range(a,100):
    b3=b**3
    if b!=a:
      for c in range(1,100):
        c3=c**3
        if c!=b and c!=a:
          for d in range(c,100):
            d3=d**3
            if d!=c and d!=b and d!=a:
              if a3 + b3 == c3 + d3 :
                print("found: {0}**3 + {1}**3 == {2}**3 + {3}**3".format(a,b,c,d))
end=time.time()
print("take {0} seconds ".format(end-start))
?