Добавил:
Beka_on
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:системний аналіз / програмування / лабораторні / лр10
.txt#include <iostream>
#include <map>
#include <cctype>
int main() {
using namespace std;
string text;
cout << "Введіть текст: ";
getline(cin, text);
map<char, int> letterCount;
for (char c : text) {
if (isalpha(c)) {
letterCount[c]++;
}
}
cout << "Кількість букв у тексті:" << endl;
for (const auto& pair : letterCount) {
cout << pair.first << ": " << pair.second << endl;
}
return 0;
}