Skip to content

Hey this is not a issue i don't get any way to talk you i need a help for a math Β #6

@WeB-CoDeR-01

Description

@WeB-CoDeR-01

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 = -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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions