#include using namespace std; void cspace(int &f)//输出 { if(f) { cout<<" "; f=0; } } int zhengfu(char c)//判断是否是+、-号 { if(c=='+'||c=='-') return 1; return 0; } int num(char c)//判断是否是数字或小数点 { if((c>='0'&&c<='9')||c=='.') return 1; return 0; } int youxian(char a,char b)//符号优先级 { if(b==')') return 1; if(a=='('||b=='(') return 0; switch(b) { case '+': case '-': return 1; case '*': case '/': switch(a) { case '*': case '/': return 1; case'+': case'-': return 0; } } } int main() { char a[21],s[21]; cin>>a; int length=strlen(a),m=0,flag=0;//m是栈的下标,flag记录空格 for(int i=0; i