Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
9,088
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1.  
  2. a = int(input())
  3. b = int(input())
  4. c = int(input())
  5.  
  6. d = int(input())
  7. e = int(input())
  8. f = int(input())
  9.  
  10. def func1(x, y):
  11. return a*x + b*y - c
  12. def func2(x, y):
  13. return d*x + e*y - f
  14. finalx = 100
  15. finaly = 100
  16. for x in range(-10, 11):
  17. for y in range(-10,11):
  18. if func1(x,y) == func2(x,y) and func1(x,y) == 0:
  19. finalx = x
  20. finaly = y
  21. if finalx != 100:
  22. print(finalx, finaly)
  23. else:
  24. print('No solution')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement