#include <iostream> #include <stack> using namespace std; int main() { stack<int> s; for(int i = 0;i < 10; i++) { s.push(i); } cout << "size:" <<s.size() <<endl; while(!s.empty()) { cout << s.top() << endl; s.pop(); } return 0; }
posted on 2017-03-08 21:16 夏晴天 阅读(84) 评论(0) 编辑 收藏 举报
Powered by: 博客园 Copyright © 2025 夏晴天 Powered by .NET 9.0 on Kubernetes