Created
May 21, 2019 22:32
-
-
Save Thiago4532/383944db88418ee665ad805c370fcfd7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <queue> // Biblioteca da fila | |
| using namespace std; | |
| int main() { | |
| queue<int> fila; // Declara uma queue do tipo int | |
| fila.push(1); // Insere o elemento 1 atrás na fila | |
| fila.push(3); // Insere o elemento 3 atrás na fila | |
| fila.push(4); // Insere o elemento 4 atrás na fila | |
| fila.push(9); // Insere o elemento 9 atrás na fila | |
| while(!fila.empty()) { // Enquanto a fila nao estiver vazia | |
| cout << fila.front() << " "; // Imprime o ele | |
| fila.pop(); | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment