Guest User

Untitled

a guest
Feb 17th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int y;
  8. cin >> y;
  9. int found = 0;
  10. while (found == 0)
  11. {
  12. y++;
  13. int mark[10] = {}, repeat = 0, x = y;
  14. while (x > 0)
  15. {
  16. int d = x % 10;
  17. if (mark[d] == 1)
  18. repeat = 1;
  19. mark[d] = 1;
  20. x /= 10;
  21. }
  22.  
  23. if (repeat == 0)
  24. found = 1;
  25. }
  26. cout << y << endl;
  27. }
Add Comment
Please, Sign In to add comment