Error_code copy_stack(Stack &dest,Stack &source) { Error_code detected=success; Stack temp; Stack_entry item; while(detected==success&&!source.empty()} { detected=source.top(item); detected=source.pop(); if(detected==success)detected=temp.push(item); } while (detected==success&&!temp.empty() { detected=temp.top(itemp); detected=temp.pop(); if (detected==success)detected=source.push(item); if (detected==success)detected=dest.push(item); } return detected; }
zuo ye
最新推荐文章于 2024-05-02 19:54:31 发布