Reward score: 20 | There is still 14 days and 7 hours before the end of the question | Questioner: Zheng Da 00 10 | Improvement of the accusation calculator.
Time limit: 1000MS memory limit: 65536K
Total submitted: 56 Accepted: 7
describe
NCL is a laboratory specialized in improving and upgrading calculators. Recently, the laboratory received a task entrusted by a company: it needs to add the function of solving a linear equation of one variable to a certain calculator of the company. The lab gave this task to Mr. ZL, a novice who just came in. In order to accomplish this task well, Mr. ZL first studied some examples of linear equations:
4+3x=8
6a-5+ 1=2-2a
-5+ 12y=0
Mr. ZL was told by the supervisor that the one-dimensional linear equation typed on the calculator only contains three mathematical symbols: integer, lowercase letter and+,-and = (of course, the symbol "-"can be a minus sign or a minus sign). There are no brackets and divisors in the equation, and the letters in the equation represent unknowns.
Write a program to solve the input linear equation and output the result of solving the equation (accurate to three decimal places) to the screen.
You can assume that the correctness of typed equations is judged by another programmer, or you can think that all typed linear equations are legal and have unique real number solutions.
invest
One-dimensional linear equation
output
Solutions of one-dimensional linear equations
Sample value input
6a-5+ 1=2-2a
Sampling output
a=0.750