fork download
  1. #include <iostream>
  2. #include <unordered_set>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. string word;
  9. cin >> word;
  10.  
  11. unordered_set<char> uniqueLetters;
  12.  
  13. // Подсчитываем количество уникальных букв в слове
  14. for (char letter : word) {
  15. uniqueLetters.insert(letter);
  16. }
  17.  
  18. // Выводим количество уникальных букв в слове
  19. cout << uniqueLetters.size() << endl;
  20.  
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0.01s 5304KB
stdin
KOLOBOK
stdout
4