Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int y;
- cin >> y;
- int found = 0;
- while (found == 0)
- {
- y++;
- int mark[10] = {}, repeat = 0, x = y;
- while (x > 0)
- {
- int d = x % 10;
- if (mark[d] == 1)
- repeat = 1;
- mark[d] = 1;
- x /= 10;
- }
- if (repeat == 0)
- found = 1;
- }
- cout << y << endl;
- }
Add Comment
Please, Sign In to add comment