简单计算器
#include <iostream>
using namespace std;
int main()
{
int a,b;
char c;
cin>>a>>b;
cin>>c;
if(b==0)
{
cout<<"Divided by zero!"<<endl;
}
else if(c!='+'&&c!='-'&&c!='*'&&c!='/')
{
cout<<"Invalid operator!"<<endl;
}
else if(c=='+')
{
cout<<a+b<<endl;
}
else if(c=='-')
{
cout<<a-b<<endl;
}
else if(c=='*')
{
cout<<a*b<<endl;
}
else if(c=='/')
{
cout<<a/b<<endl;
}
return 0;
}