#include <iostream>
#include <map>
int main()
{
std::string s = "c c++ c# java python";
std::map<char, std::size_t> frequency;
for (auto ch : s)
{
if (frequency.find(ch) == frequency.end())
frequency[ch] = 1;
else
frequency[ch]++;
}
for (auto element : frequency)
std::cout << element.first << " : " << element.second << std::endl;
return 0;
}
/*
run:
: 4
# : 1
+ : 2
a : 2
c : 3
h : 1
j : 1
n : 1
o : 1
p : 1
t : 1
v : 1
y : 1
*/