Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Codeforces Round 271A
- #include <string>
- #include <cstring>
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- char mass[4];
- cin >> n;
- for(int i=0;i<10000;i++)
- {
- n++;
- string s = to_string(n);
- strcpy(mass, s.c_str());
- if(mass[0]!=mass[1] && mass[0]!=mass[2] && mass[0]!=mass[3] && mass[1]!=mass[2] && mass[1]!=mass[3] && mass[2]!=mass[3])
- {
- cout << mass;
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement