Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string s;
- cin >> s;
- if (s[1]=='+') {
- if (s[0]=='x') cout << s[4]-s[2];
- if (s[2]=='x') cout << s[4]-s[0];
- if (s[4]=='x') cout << s[0]+s[2]-96;
- } else {
- if (s[0]=='x') cout << s[4]+s[2]-96;
- if (s[2]=='x') cout << s[0]-s[4];
- if (s[4]=='x') cout << s[0]-s[2];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement