I got some error after a limited time. When i tried it to javascript but there also the same error i don't know what is the problem
if you set the z = 50 and target = 33 the error you will find
I want that fix this error. So i can calculate limit less number.
x = 3
target = 81
a = -1*x
b = -1*x
c = -1*x
def main():
def result():
global a
global b
global c
cheack = ((a*a*a)+(b*b*b)+(c*c*c))
print("Your result:")
print(a)
print(b)
print(c)
print(cheack)
def math_1():
global a
global b
global c
cheack = ((a*a*a)+(b*b*b)+(c*c*c))
if cheack == target:
result()
elif a == x:
math_2()
else :
a += 1
math_1()
def math_2():
global a
global b
global c
cheack = ((a*a*a)+(b*b*b)+(c*c*c))
if cheack == target:
result()
elif b == x:
math_3()
elif a == x:
a = -1*x
b += 1
math_1()
else:
print("Error!")
def math_3():
global a
global b
global c
cheack = ((a*a*a)+(b*b*b)+(c*c*c))
if cheack == target:
result()
elif c == x:
print("Sorry.. Arman!")
elif b == x:
a = -1*x
b = -1*x
c += 1
math_1()
math_1()
main()
I got some error after a limited time. When i tried it to javascript but there also the same error i don't know what is the problem if you set the z = 50 and target = 33 the error you will find I want that fix this error. So i can calculate limit less number.