Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include <iostream>
#include <map>
using namespace std;
typedef map<unsigned,int> Map;
typedef pair<unsigned,int> Pair;
int CountColors(unsigned img[256][256])
{
Map count;
for (int i = 0; i < 256; ++i)
for (int j = 0; j < 256; ++j)
++count[img]i[/img][j]]; // new pair created and init with 0
Map::const_iterator x;
Pair p;
for (x = count.begin();x != count.end();++x)
{
p = *x;
cout << hex << p.first << "\t" << dec << p.second << endl;
}
return count.size();
}