1 개요[ | ]
- C++ stack
- C++ 스택
C++
CPU
0.4s
MEM
56M
0.4s
Copy
#include <iostream>
#include <stack>
using namespace std;
void show(stack<int> s) {
stack<int> ss = s;
while(!ss.empty()) {
cout << ss.top() << ' ';
ss.pop();
}
cout << '\n';
}
int main() {
stack<int> s;
s.push(3);
s.push(1);
s.push(4);
s.push(8);
show(s); // 8 4 1 3
}
8 4 1 3
2 같이 보기[ | ]
3 참고[ | ]
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.