Untitled
unknown
plain_text
2 years ago
414 B
7
Indexable
#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;
}Editor is loading...
Leave a Comment