Untitled

mail@pastecode.io avatar
unknown
plain_text
23 days ago
414 B
2
Indexable
Never
#include <iostream>
#include <string>

using namespace std;

int main(){

    freopen("year.inp","r",stdin);
    freopen("year.out","w",stdout);

    int n; cin >> n;

    string s;
    while(++n){
        s = to_string(n);
        if(s[0] != s[1] && s[0] != s[2] && s[0] != s[3] && s[1] != s[2] && s[1] != s[3] && s[2] != s[3])
            break;
    }
    cout << n << endl;

    return 0;
}
Leave a Comment