文章
37
粉丝
98
获赞
4
访问
22.6k
#include<iostream>
#include<algorithm>
#include<stack>
#include<string>
using namespace std;
struct oper {
char ch;
int priority;//运算符优先级
};
//计算
double cal(double a,double b, struct oper top) {
//进行计算
double ans;
if (top.ch == '+') {
ans = a + b;
}
else if (top.ch == '-') {
ans = a - b;
}
else if (top.ch == '*') {
ans = a * b;
}
else {
ans = a / b;
}
return ans;
}
int main()
{
string s;
while (cin >> s) {
...
登录后发布评论
暂无评论,来抢沙发