Created
February 13, 2009 23:35
-
-
Save scooby/64166 to your computer and use it in GitHub Desktop.
multimap test insert and iterating
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <map> | |
using namespace std; | |
int main(void) { | |
multimap<int, int> mm; | |
for(int i = 20; i; i--) | |
mm.insert(make_pair((i * 3) & 7 + i, (i * 5) & 7)); | |
multimap<int, int>::iterator it = mm.begin(); | |
while(it != mm.end()) { | |
pair<int, int> p = *it; | |
cout << "k: " << p.first << ", v: " << p.second << endl; | |
it++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment