Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int distinctValueCount(int array[], int n)
- {
- int distinctValue = 1;
- for(int i = 0; i < n; i++)
- {
- for(int j = 0; j < n; j++)
- {
- if(array[i] = array[j])
- {
- break;
- }
- if(i==j)
- {
- distinctValue++;
- }
- }
- }
- return distinctValue;
- }
- int main()
- {
- string in_string;
- getline(cin, in_string);
- int size = in_string.size();
- vector<int> value;
- for(int i = 0; i<size; i++)
- {
- if(in_string[i]<123 && in_string[i]>96)
- {
- int j = in_string[i];
- value.push_back(j);
- }
- }
- int n = value.size();
- cout<<distinctValueCount(value, n);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement