daily pastebin goal
34%
SHARE
TWEET

24

a guest Mar 21st, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //24
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int n;
  9.     cin >> n;
  10.     int m[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  11.     while(n != 0){
  12.         int a = n % 10;
  13.         m[a]++;
  14.         n /= 10;
  15.     }
  16.     for(int i = 0; i < 10; i++){
  17.         if(m[i] > 1){
  18.             cout << "NO";
  19.             return 0;
  20.         }
  21.     }
  22.     cout << "YES";
  23.     return 0;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top