|
A 6
B 4
C 5
[code]
static void MyGroupMyCommand4()
{
vector<CString> vec;
vec.push_back(_T("A"));
vec.push_back(_T("A"));
vec.push_back(_T("B"));
vec.push_back(_T("C"));
vec.push_back(_T("C"));
vec.push_back(_T("A"));
vec.push_back(_T("B"));
vec.push_back(_T("C"));
vec.push_back(_T("A"));
vec.push_back(_T("B"));
vec.push_back(_T("B"));
vec.push_back(_T("C"));
vec.push_back(_T("C"));
vec.push_back(_T("A"));
vec.push_back(_T("A"));
map<CString, int>map1;
for(int i = 0; i < vec.size(); i++)
{
map1[vec[i]]++;
}
for(auto it = map1.begin(); it != map1.end(); it++)
{
acutPrintf(_T("\n%s %d "), it->first,it->second);
}
}[/code] |
|