小点


清空栈
while(!s.empty()) s.pop(); 

或者 与空栈交换

stack<int> s;
stack<int>().swap(s);

相关