Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. #include <iostream>
  2. #include <queue>
  3.  
  4. using namespace std;
  5.  
  6. void memoryInfo(queue <double> queueMem)
  7. {
  8. cout << "Rozmiar kolejki FIFO: "
  9. << queueMem.size()
  10. << ", w bajtach: "
  11. << queueMem.size() * sizeof(string)
  12. << endl;
  13. }
  14.  
  15.  
  16. int main()
  17. {
  18.  
  19. queue <string> kolejka;
  20.  
  21. kolejka.push("pomoc mamie");
  22. kolejka.push("zrobic lekcje");
  23. kolejka.push("wnieść śmieci");
  24.  
  25.  
  26.  
  27.  
  28. cout<<"1. usuwanie \n";
  29. cout<<"2. dodawanie \n";
  30. cout<<"3. koniec \n";
  31. int kolejnosc;
  32.  
  33. do{
  34. cin>>kolejnosc;
  35. switch(kolejnosc)
  36. {
  37.  
  38. {
  39. case 1:
  40. {
  41.  
  42. string first = kolejka.front();
  43. cout << "Zrobione: " << first << endl;
  44. kolejka.pop();
  45. }
  46.  
  47. break;
  48.  
  49. case 2:
  50. {
  51. }
  52.  
  53.  
  54.  
  55. break;
  56.  
  57. case 3:{
  58. break;
  59. }
  60. return 1;
  61.  
  62. break;
  63. }
  64. }
  65. }while (kolejnosc!=3);
  66.  
  67. return 0;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement