Oct-20-2017, 06:37 PM
Python3
I have no idea where to start for this problem....
Write a program that solves a linear equation ax = b in integers. Given two integers a and b (a may be zero), print a single integer root if it exists and print "no solution" or "many solutions" otherwise.
Example Input #1:
1
-2
Example Output #1:
-2
Example Input #2:
2
-1
Example Output #2:
no solution
I have no idea where to start for this problem....
Write a program that solves a linear equation ax = b in integers. Given two integers a and b (a may be zero), print a single integer root if it exists and print "no solution" or "many solutions" otherwise.
Example Input #1:
1
-2
Example Output #1:
-2
Example Input #2:
2
-1
Example Output #2:
no solution