Advertisement
dllbridge

Untitled

Nov 24th, 2022
768
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.29 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. string a;
  5. int b[27], q;
  6.  
  7.  
  8.  
  9. ///////////////////////////////////////////////////////
  10. int main()                                          //
  11. {
  12.     cin >> a;
  13.  
  14.     for(int i = 0; i < a.size(); i++)
  15.     {
  16.        if(a[i] == ' ') b[26] = 0;    
  17.        if(a[i] == 'a') b[0] = 1;
  18.        if(a[i] == 'b') b[1] = 1;
  19.        if(a[i] == 'c') b[2] = 1;
  20.        if(a[i] == 'd') b[3] = 1;
  21.        if(a[i] == 'e') b[4] = 1;
  22.        if(a[i] == 'f') b[5] = 1;
  23.        if(a[i] == 'g') b[6] = 1;
  24.        if(a[i] == 'h') b[7] = 1;
  25.        if(a[i] == 'i') b[8] = 1;
  26.        if(a[i] == 'j') b[9] = 1;
  27.        if(a[i] == 'k') b[10] = 1;
  28.        if(a[i] == 'l') b[11] = 1;
  29.        if(a[i] == 'm') b[12] = 1;
  30.        if(a[i] == 'n') b[13] = 1;
  31.        if(a[i] == 'o') b[14] = 1;
  32.        if(a[i] == 'p') b[15] = 1;
  33.        if(a[i] == 'q') b[16] = 1;
  34.        if(a[i] == 'r') b[17] = 1;
  35.        if(a[i] == 's') b[18] = 1;
  36.        if(a[i] == 't') b[19] = 1;
  37.        if(a[i] == 'u') b[20] = 1;
  38.        if(a[i] == 'v') b[21] = 1;
  39.        if(a[i] == 'w') b[22] = 1;
  40.        if(a[i] == 'x') b[23] = 1;
  41.        if(a[i] == 'y') b[24] = 1;
  42.        if(a[i] == 'z') b[25] = 1;
  43.     }
  44.    
  45.    
  46.     for(int i = 0; i < 26; i++) if(b[i] == 1) q++;
  47.     cout << q;
  48. }
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement