#include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
string s1,s2,oper;
getline(cin,s);
int a=s.find(" ");
s1=s.substr(0,a);
s.erase(0,a+1);
int b=s.find(" ");
oper=s.substr(0,b);
s.erase(0,b+1);
s2=s;
int c=atoi(s1.c_str());
int d=atoi(s2.c_str());
if(oper=="+")
cout<<c+d<<endl;
else if(oper=="-")
cout<<c-d<<endl;
else
cout<<0<<endl;
return 0;
}
注意 VC6.0中getline()函數需要輸入兩次回車才能輸入,可能是VC6.0的bug,在VS2010中輸入一次回車就可以