BETA

Difficulty Level: Basic

Submissions: 1469 Accuracy:

21.31%

Evaluate the x + a = b statement
     

Given a string of form x + a = b where a and b are integer, find value of x [Note that spaces may or may not be there, for example, input can either be x+a=b or x + a = b or x+a = b].

For example if input string is x + 12 = 3 then output should be -9

 

Constraints:
1 <=T<= 30
1 <=a,b<= 1000

Example:
Input:

2
x+5=2
x+10=20

Output:
-3
10

 

** For More Input/Output Examples Use 'Expected Output' option **

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.