Skip to content

Instantly share code, notes, and snippets.

@mudream4869
Created May 28, 2014 10:35
Show Gist options
  • Select an option

  • Save mudream4869/23fcfcadaa77e4e16120 to your computer and use it in GitHub Desktop.

Select an option

Save mudream4869/23fcfcadaa77e4e16120 to your computer and use it in GitHub Desktop.
range in map
#include<map>
#include<cstdio>
#include<cstdlib>
typedef std::map<int, int> mic;
typedef std::map<int, int>::iterator itmic;
int main(){
mic mmap;
itmic it;
for(int lx = 0;lx < 100000;lx++)
mmap[lx] = (lx*lx + 1)%1932712;
itmic start = mmap.find(20);
itmic end = mmap.find(100);
end++;
for(itmic it = start;it != end;it++){
printf("%d -> %d\n", it->first, it->second);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment