G2A Many GEOs
SHARE
TWEET

Untitled

a guest Mar 30th, 2020 176 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<sstream>
  3. #include<string>
  4. #include<bits/stdc++.h>
  5. using namespace std;
  6. int main()
  7. {
  8.     int n,i;
  9.     cin>>n;
  10.      int d=1;
  11.     for( i=n+1;i<=9000;i++)
  12.     {
  13.          stringstream ss;
  14.      ss<<i;
  15.      string s;
  16.       ss>>s;
  17.          sort(s.begin(), s.end());
  18.          //cout<<s.size();
  19.           for(int j=0;j<s.size();j++)
  20.         {
  21.  
  22.  
  23.                  //cout<<s[j];
  24.             if(s[j]==s[j+1])
  25.             {
  26.                 d=0;
  27.                 break;
  28.             }
  29.             //cout<<676;
  30.  
  31.  
  32.         }
  33.         //cout<<d;
  34.         if(d==1)
  35.         {
  36.             cout<<i;
  37.             goto A;
  38.         }
  39.  
  40.         //cout<<s<<endl;
  41.         //break;
  42.  
  43.  
  44.     }
  45.     A:
  46.         return 0;
  47.     //cout<<i<<endl;
  48. }
RAW Paste Data
Ledger Nano X - The secure hardware wallet
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