#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
int i=1,n,z;
cin>>s;
z=s[0]-48;n=s.length();
while(i<n)
{
if(s[i]==‘+‘) z=z+(s[i+1]-48);
else if(s[i]==‘-‘) z=z-(s[i+1]-48);
else if(s[i]==‘*‘) z=z*(s[i+1]-48);
else z=z/(s[i+1]-48);
i=i+2;
}
cout<<z<<endl;
return 0;
}
时间: 2024-10-06 03:16:34