#P1689. 方程求解
方程求解
Description
Given an equation of the form or . Among , , and , two values are given, and the remaining one is represented by ?. Compute the value of ?. There may be extra spaces in the equation.
Input Format
The input consists of a single line containing a string representing the equation.
Output Format
Output one integer on a single line, which is the value represented by ?.
1+2=?
3
3 +? = 2
-1
3-?=2
1
Hint
Constraints: For of the testdata, it is guaranteed that , the input string always conforms to the specified format, and its length does not exceed .
Translated by ChatGPT 5
京公网安备 11011102002149号