#Numerous engineering and scientific applications require finding solutions to a set of equations.
#Ex: 8x + 7y = 38 and 3x - 5y = -1 have a solution x = 3, y = 2.
#Given integer coefficients (a, b, c, d, e, and f) of two linear equations
#with variables x and y listed below, use brute force to find an integer solution for x and y in the range -10 to 10.
#ax + by = c
#dx + ey = f
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())
#defines the solution, and it's set to False unless defined later in a loop or function
solution_found = False
#Remember its a range for loop because their is no set amount of numbers
for x in range(-10,11):
for y in range(-10, 11):
if a*x + b*y == c and d*x + e*y == f:
print(f' x = {x} , y = {y}')
solution_found = True
if not solution_found:
print("There is no solution")
To embed this project on your website, copy the following code and paste it into your website's HTML: