题目链接:http://lx.lanqiao.cn/problem.page?gpid=T225
题目:
思路:
没啥可说的,我想的应该是运算符和对象是在一个字符串里哎,可是这样居然也能过
算了,不管了
代码:
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
int a,b,ans;
cin>>s>>a>>b;
switch(s[0])
{
case '+':ans=a+b;break;
case '-':ans=a-b;break;
case '*':ans=a*b;break;
case '/':ans=a/b;break;
}
cout<<ans<<endl;
return 0;
}