fork download
  1. #include <vector>
  2. #include <string>
  3. #include <iostream>
  4. #include <iomanip>
  5. using namespace std;
  6.  
  7. class primer{
  8. public:
  9. string date;
  10. string hello;
  11. };
  12. int main()
  13. {
  14. primer p[2];
  15. vector<vector<primer>> p1;
  16. vector<primer> p2;
  17. string q = "qwerty";
  18. p[0].date = "22.01";
  19. p[0].hello = "asd";
  20. p2.push_back(p[0]);
  21. p1.push_back(p2);
  22. p[1].date = "22.19";
  23. p[1].hello = "qwerty";
  24. p2.push_back(p[1]);
  25. p1.push_back(p2);
  26. for(const auto& p: p1)
  27. {
  28. for(const auto& r: p)
  29. if (r.hello == q)
  30. for(const auto& v: p)
  31. cout << v.date << " " << v.hello << "\n";
  32. }
  33. }
Success #stdin #stdout 0s 4484KB
stdin
Standard input is empty
stdout
22.01 asd
22.19 qwerty