[IT]/알고리즘
[알고리즘] 간단한 스택 사용(C++)
working_hard
2019. 5. 31. 15:52
728x90
#include <iostream>
#include<stack>
using namespace std;
int main(){
stack<int> st;
st.push(7);
st.push(5);
st.push(4);
st.pop();
st.push(6);
st.pop();
while (!st.empty()) {
cout << st.top() << " ";
st.pop();
}
return 0;
}