#include<iostream>
#include<stack>

using namespace std;

int main()
{
	stack<int> s;
	
	s.push(7);
	s.push(5);
	s.push(4);

	s.pop();
	s.push(6);
	s.pop();
	
	while (!s.empty())
	{
		cout << s.top() << ' ';
		s.pop();
	}

	return 0;
}

'Algorithm > Basic_Algorithm' 카테고리의 다른 글

깊이 우선 탐색(DFS).  (0) 2020.02.08
너비 우선 탐색(BFS).  (0) 2020.02.08
큐(Queue).  (0) 2020.02.08
계수정렬(Counting Sort).  (0) 2020.02.08
힙정렬(Heap Sort).  (0) 2020.02.08
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 라이프코리아트위터 공유하기
  • shared
  • 카카오스토리 공유하기