首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

急求该函数的功能解决方案

2012-04-08 
急求该函数的功能voidDemo2(SeqStack*S,intm)   {//设DataType为int型    SeqStackTinti    InitStack(&

急求该函数的功能
void   Demo2(   SeqStack   *S,   int   m)  
   {   //   设DataType   为int   型
    SeqStack   T;   int   i;
    InitStack   (&T);
    while   (!   StackEmpty(   S))
     if((   i=Pop(S))   !=m)   Push(   &T,i);
    while   (!   StackEmpty(   &T))
     {
      i=Pop(&T);   Push(S,i);
     }
   }


[解决办法]
从栈S中删除 值为m的元素
[解决办法]
关键: 
   while (! StackEmpty( S))
     if(( i=Pop(S)) !=m)
Push( &T,i);

至于功能楼上的已经说了.
[解决办法]
正确

热点排行