Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $n = 15;
- $printed = false;
- $regex = "/^(?:([0-9])(?!.*\\1))*$/";
- if ($n <= 102) {
- echo "no";
- }
- else {
- for ($i=102; $i < $n; $i++) {
- if (preg_match($regex, strval($i))) {
- echo $i . PHP_EOL;
- $printed = true;
- }
- }
- if (!$printed) {
- echo "no";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement