#include <iostream>
#include <string>
#include <map>
std::map<char, int> CountNumberOfEachVowelInString(const std::string& s) {
std::string vowels = "aeiou";
std::map<char, int> countVowels;
for (char ch : vowels) {
countVowels[ch] = 0;
}
return countVowels;
}
int main() {
std::string s = "python c c++ c# java php javascript";
std::map<char, int> countVowels = CountNumberOfEachVowelInString(s);
for (char ch : s) {
if (countVowels.find(ch) != countVowels.end()) {
countVowels[ch]++;
}
}
for (const auto& pair : countVowels) {
std::cout << pair.first << ": " << pair.second << std::endl;
}
}
/*
run:
a: 4
e: 0
i: 1
o: 1
u: 0
*/