Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $n = readline();
- for ($i = 1111; $i < 9999; $i++) {
- $isSpecial = true;
- for ($j = 0; $j <= 3; $j++) {
- $currentNumber = strval($i);
- $digit = $currentNumber[$j];
- if ($digit == 0) {
- $isSpecial = false;
- break;
- }
- if ($n % $digit != 0) {
- $isSpecial = false;
- break;
- }
- }
- if($isSpecial){
- echo $i.' ';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement