-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Description
Look
I have integer number like x = 33
I need programme that can provide me a , b, c
equation is :
x = (aaa+bbb+ccc)
so i builded a file but that not work that much. It crushed after a limit. So, please help me.
When i put x = 9 and then try to use target 43 then work but when put 10 on x then it not work. Why?
x = 9
target = 43
a = -1x
b = -1x
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()
trisitc and Varun270
Metadata
Metadata
Assignees
Labels
No labels