后缀表达式求值计算.cpp

时间:2022-12-11 07:37:44
【文件属性】:
文件名称:后缀表达式求值计算.cpp
文件大小:985B
文件格式:CPP
更新时间:2022-12-11 07:37:44
后缀表达式 ////数字与运算符直接要有空格 //#include //#include //#include //#include //using namespace std; //char s[10000]; //stack p; //long long x,y; //int main(){ // gets_s(s); // int i=0; // while(s[i]!='@'){ // switch(s[i]){ // case '+': // y=p.top();p.pop();x=p.top();p.pop();p.push(x+y);break; // case '-': // y=p.top();p.pop();x=p.top();p.pop();p.push(x-y);break; // case '*': // y=p.top();p.pop();x=p.top();p.pop();p.push(x*y);break; // case '/': // y=p.t

网友评论