Laitofai

2

May 5th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. //#2
  2. #include <iostream>
  3. #include <cstring>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     char str[50];
  10.     cin.getline(str, 50);
  11.     int c = 0;
  12.     bool flag = 0;
  13.     for(int i = 1; i < strlen(str); i++){
  14.         flag = 0;
  15.         for(int j = i - 1; j >= 0; j--){
  16.             if(tolower(str[i]) == tolower(str[j])){
  17.                 flag = 1;
  18.                 break;
  19.             }
  20.         }
  21.         if(flag == 0){
  22.             c++;
  23.         }
  24.     }
  25.     cout << c;
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment