Advertisement
sazid_iiuc

Untitled

May 26th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     string in_string, second_string;
  7.  
  8.     getline(cin, in_string);
  9.  
  10.     int j = 0, count = 1;
  11.  
  12.     int size_in = in_string.size();
  13.  
  14.  
  15.     for(int i = 0; i < size_in; i++)
  16.     {
  17.         if(in_string[i]<123 && in_string[i]>96)
  18.         {
  19.             second_string[j]=in_string[i];
  20.             j++;
  21.         }
  22.     }
  23.  
  24.     int size_second = second_string.size();
  25.  
  26.     for(int i = 0; i < size_second; i++)
  27.     {
  28.         for(int j = 0; j < size_second; j++)
  29.         {
  30.             if(second_string[i]==second_string[j])
  31.             {
  32.                 break;
  33.             }
  34.  
  35.             if(i==j)
  36.             {
  37.                 count++;
  38.             }
  39.         }
  40.     }
  41.  
  42.     cout<<count;
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement