Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- string a;
- int b[27], q;
- ///////////////////////////////////////////////////////
- int main() //
- {
- cin >> a;
- for(int i = 0; i < a.size(); i++)
- {
- if(a[i] == ' ') b[26] = 0;
- if(a[i] == 'a') b[0] = 1;
- if(a[i] == 'b') b[1] = 1;
- if(a[i] == 'c') b[2] = 1;
- if(a[i] == 'd') b[3] = 1;
- if(a[i] == 'e') b[4] = 1;
- if(a[i] == 'f') b[5] = 1;
- if(a[i] == 'g') b[6] = 1;
- if(a[i] == 'h') b[7] = 1;
- if(a[i] == 'i') b[8] = 1;
- if(a[i] == 'j') b[9] = 1;
- if(a[i] == 'k') b[10] = 1;
- if(a[i] == 'l') b[11] = 1;
- if(a[i] == 'm') b[12] = 1;
- if(a[i] == 'n') b[13] = 1;
- if(a[i] == 'o') b[14] = 1;
- if(a[i] == 'p') b[15] = 1;
- if(a[i] == 'q') b[16] = 1;
- if(a[i] == 'r') b[17] = 1;
- if(a[i] == 's') b[18] = 1;
- if(a[i] == 't') b[19] = 1;
- if(a[i] == 'u') b[20] = 1;
- if(a[i] == 'v') b[21] = 1;
- if(a[i] == 'w') b[22] = 1;
- if(a[i] == 'x') b[23] = 1;
- if(a[i] == 'y') b[24] = 1;
- if(a[i] == 'z') b[25] = 1;
- }
- for(int i = 0; i < 26; i++) if(b[i] == 1) q++;
- cout << q;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement