#include<iostream>
#include<cmath>
using namespace std;
int main(){
string s; getline(cin,s);
int r;
string s1 = "";
for(int i = 0; i <= s.size()-1; i++){
if(s[i] != ' ') s1 += s[i];
}
int op,w,d;
char p;
for(int i = 0; i <= s1.size()-1; i++){
if(s1[i] == '+' || s1[i] == '-') {op = i;p = s1[i];}
if(s1[i] == '?'){w = i;}
if(s1[i] == '='){d = i;}
}
if(d < w){
int x = 0, y = 0;
for(int i = 0; i <= op - 1; i++){x *= 10; x += s1[i]-'0';}
for(int i = op + 1; i < d; i++){y *= 10; y += s1[i]-'0';}
if(p == '+') cout << x + y;
else cout << x - y;
}
else if(op < w){
int x = 0, y = 0;
for(int i = 0; i <= op - 1; i++){x *= 10; x += s1[i]-'0';}
for(int i = d + 1; i < s1.size(); i++){y *= 10; y += s1[i]-'0';}
if(p == '+') cout << y - x;
else cout << x - y;
}
else{
int x = 0, y = 0;
for(int i = op + 1; i <= d - 1; i++){x *= 10; x += s1[i]-'0';}
for(int i = d + 1; i < s1.size(); i++){y *= 10; y += s1[i]-'0';}
if(p == '+') cout << y - x;
else cout << x + y;
}
}
思路是先去掉空格再识别符号、等号、?,然后根据这三个的位置去算,样例全都过了,但只有50分