oBed

mail@pastecode.io avatar
unknown
plain_text
2 years ago
497 B
0
Indexable
Never
#include <iostream>
#include <string>


using namespace std;
int main()
{

	string str;

	cin >> str;

	if (str[0] == 'x')
		if (str[1] == '+') cout << int(str[4] - str[2]);

		else cout << int(str[4]) - 48 + int(str[2]) - 48;

	else if (str[2] == 'x')
		if (str[1] == '+') cout << int(str[4] - str[0]);

		else cout << int(str[0]) - 48 - (int(str[4]) - 48);
	else
		if (str[1] == '+') cout << int(str[0]) - 48 + int(str[2]) - 48;

		else cout << int(str[0] - str[2]);

}