文章
27
粉丝
0
获赞
125
访问
6.7k
#include<bits/stdc++.h>
using namespace std;
int main() {
string s;
map<int, int> mp = {{'$', 1}, {'+', 3}, {'-', 3}, {'*', 4}, {'/', 4}};//定义优先级
while(getline(cin, s)) {
if(s == "0") break;
stack<double> num;
stack<char> op;
op.push('$');
stringstream ss(s);
string word;
while(getline(ss, word, ' ')) {
char c = word[0];
if(isdigit(c)) {
num.push(stod(word));
&...
登录后发布评论
暂无评论,来抢沙发