Advertisement
Josif_tepe

Untitled

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