#define maxbuffer 64 void main() { char display_out(char out_ch[maxbuffer], char ch[32]); //int caculate_array(char out_ch[32]); static int i=0; static int j=0; char ch[maxbuffer],s[maxbuffer],out[maxbuffer]; coutch; for(i=0;i [maxbuffer],n; int j=0; char sta[20]; while(ch[i]!='#') { if(isalnum(ch[i])) { while(isalnum(ch[i])) { out_ch[j]=ch[i]; j++; i++; }out_ch[j]=' ';j++; } else{ switch(ch[i]) { case '+': case '-': if(sta[top]=='('||top==-1) { top++; sta[top]=ch[i]; i++; } else { //j--; out_ch[j]=sta[top]; j++; top--; //i++; } break; //break; case '*': case '/':if(sta[top]=='*'&&sta[top]=='/') { out_ch[j]=sta[top]; j++; //i++; top--; } else { top++; sta[top]=ch[i]; i++; } break ; //break; case '(':top++; sta[top]=ch[i]; i++; break; case ')':if(sta[top]=='(') { top--; i++; } if(top==-1) { cout< ...展开详情收缩