Morass

Map Pair Print

Mar 27th, 2016
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6.  
  7. {
  8.     int n,i,j,k;
  9.  
  10.     map< pair<int,int>, int> mp;
  11.  
  12.     cin>>n;
  13.  
  14.     for(i=2;i<=2*n;i++)
  15.     {
  16.         for(j=1;j<i;j++)
  17.         {
  18.             cin>>k;
  19.              mp[make_pair(i,j)]=k;
  20.         }
  21.     }
  22.     for(auto&h:mp)printf("[%d,%d]: %d\n",h.first.first,h.first.second,h.second);
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment