fork download
  1. #include <iostream>
  2. #include <map>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. map<int, int> a[2];
  8. a[0][10] = 2;
  9. a[1][20] = 3;
  10. for(auto itr = a[0].begin(); itr != a[0].end(); ++itr) {
  11. cout << itr->first << ":" << itr->second << "." << std::endl;
  12. }
  13. for(auto itr = a[1].begin(); itr != a[1].end(); ++itr) {
  14. cout << itr->first << ":" << itr->second << "." << std::endl;
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5652KB
stdin
Standard input is empty
stdout
10:2.
20:3.