Advertisement
ibragimova_mariam

C12 COPP

Nov 21st, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <algorithm>
  5. #include <map>
  6. #include <iterator>
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12. int n;
  13. cin >> n;
  14.  
  15. map<int, int> list;
  16.  
  17. for(int i = 0; i < n; i ++) {
  18. int a, b;
  19. cin >> a >> b;
  20. list[a] = b;
  21. }
  22.  
  23. for(auto iter = list.begin(); iter != list.end(); iter++) {
  24. cout << iter->first << " " << iter->second << endl;
  25. }
  26.  
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement