Untitled
unknown
plain_text
a year ago
414 B
6
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