할껀하고놀자

[알고리즘] 간단한 queue 구현(C++) 본문

[IT]/알고리즘

[알고리즘] 간단한 queue 구현(C++)

working_hard 2019. 5. 31. 15:56
728x90
#include <iostream>
#include<queue>

using namespace std;

int main(){
	queue<int> q;
	q.push(7);
	q.push(5);
	q.push(4);
	q.pop();
	q.push(6);
	q.pop();
	while (!q.empty()) {
		cout << q.front() << " ";
		q.pop();
	}

	return 0;
}
Comments