keymasterviriya1150

Untitled

Feb 16th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include<iostream>
  2. #include<set>
  3. #include<map>
  4. using namespace std;
  5.     /*5
  6.     A 3
  7.     B 5
  8.     C 2
  9.     D 9
  10.     E 4
  11.    
  12.     3 7*/
  13. int main()
  14. {
  15.     map<int,string> m;
  16.     int N;
  17.     cin>>N;
  18.     for(int i=0;i<N;i++)
  19.     {
  20.         int key;
  21.         string value;
  22.        
  23.         cin>>value>>key;
  24.         m[key]=value;
  25.     }
  26.     int start,stop;
  27.     cin>>start>>stop;
  28.    
  29.     for(map<int,string>::iterator it = m.lower_bound(start); it !=m.upper_bound(stop);it++)
  30.     {
  31.         //cout<< it->first<<"\n";
  32.         cout<<it->second<<"\n";
  33.     }
  34.    
  35.      
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment