Advertisement
Josif_tepe

Untitled

Mar 24th, 2022
818
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <set>
  3. #include <algorithm>
  4. using namespace std;
  5. int main()
  6. {
  7.     string s;
  8.     cin >> s;
  9.    
  10.     sort(s.begin(), s.end());
  11.     int result = 0;
  12.     do {
  13.         if(s[0] != '0') {
  14.             result++;
  15.         }
  16.        
  17.     } while(next_permutation(s.begin(), s.end()));
  18.     cout << result << endl;
  19.     return 0;
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement