【发布时间】:2016-01-19 20:30:04
【问题描述】:
我的主要功能
int main(){
Postfix post;
char size=100;
char infix[size];
string get_input=" ";
cout<<"Input Infix";
cin>>infix;
int size=strlen(infix);
char postfix[size];
post.infix_to_postfix(infix, postfix, size);
cout<<"\nInfix Expression is:"<<" "<<infix;
cout<<"\nPostfix Expression is:"<<" "<<postfix;
cout<<endl;
程序使用堆栈将中缀转换为后缀表示法。我的问题是,有没有办法一直循环,直到用户不想。 类似的
int n;
cin>>n;
while (n!=0){
// keep doing whatever
}
【问题讨论】: