fork download
  1. /******************************************************************************
  2.  
  3. Welcome to GDB Online.
  4. GDB online is an online compiler and debugger tool for C/C++.
  5. Code, Compile, Run and Debug online from anywhere in world.
  6.  
  7. *******************************************************************************/
  8. #include <iostream>
  9. #include <bits/stdc++.h>
  10. #include <queue>
  11. #include <tuple>
  12. using namespace std;
  13.  
  14. std::queue<std::tuple<unsigned int, int> >animQueue;
  15.  
  16.  
  17. int main() {
  18.  
  19. animQueue.push(std::make_tuple(1,100));
  20. animQueue.push(std::make_tuple(2,200));
  21. animQueue.push(std::make_tuple(3,300));
  22. animQueue.push(std::make_tuple(4,400));
  23.  
  24. int quesize = animQueue.size();
  25. for(int i=0; i< quesize; i++)
  26. {
  27. auto elem = animQueue.front();
  28. std::cout << get<0>(elem) << ":" << get<1>(elem) << std::endl;
  29. animQueue.pop();
  30. }
  31.  
  32.  
  33. return 0;
  34. }
  35.  
  36.  
  37.  
Success #stdin #stdout 0s 5324KB
stdin
45
stdout
1:100
2:200
3:300
4:400