Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#2
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main()
- {
- char str[50];
- cin.getline(str, 50);
- int c = 0;
- bool flag = 0;
- for(int i = 1; i < strlen(str); i++){
- flag = 0;
- for(int j = i - 1; j >= 0; j--){
- if(tolower(str[i]) == tolower(str[j])){
- flag = 1;
- break;
- }
- }
- if(flag == 0){
- c++;
- }
- }
- cout << c;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment