C++教程:C++向量讲解

2020-01-06 12:22:20于丽

   char temp;
   cout <<"请输入指令:" <<endl;
   do
   {
      cin >>temp;
      if (temp!='#')
      {
         if (temp!='$')
         {
            stack.push_back(temp);//模拟压栈操作
         }
        else
         {
            stack.pop_back();//模拟退栈操作
         } 
      }
   }while (temp!='#');
   for (int i=0;i<stack.size();i++)