Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int n;
- int cifre ( int n ){
- int numere = 0, v[10];
- for ( int i = 1; i <= 9; i++ ) v[i] = 0;
- while ( n ){
- v[ n % 10]++;
- n /= 10;
- }
- for ( int i = 0; i <= 9; i++ )
- if ( v[i] == 1 )
- numere++;
- return numere;
- }
- int main()
- {
- cin >> n;
- cout << cifre(n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment