Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #include <queue>
  3. using namespace std;
  4. int main()
  5. {
  6. queue<string> ins;
  7. string str;
  8. getline(cin, str);
  9. char *token = strtok(&str[0], " ");
  10. while (token != NULL)
  11. {
  12. token = strtok(NULL, " ");
  13. ins.push(token);
  14. }
  15. while(!ins.empty()) {
  16. cout << "Popping ";
  17. cout << ins.front() << "\n";
  18. ins.pop();
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement