fork download
  1. #include <iostream>
  2. #include <map>
  3. using namespace std;
  4.  
  5. int main() {
  6. std::map<int, int> map;
  7. for (int i = 0 ; i < 10 ; i++)
  8. {
  9. map[i]++;
  10. }
  11.  
  12. for (int i = 0 ; i < 10 ; i+=2)
  13. {
  14. map[i]++;
  15. }
  16.  
  17. for(auto item : map)
  18. {
  19. if (item.second % 2 == 1)
  20. {
  21. cout << item.first;
  22. }
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
13579