Anonymous user
Numbers divisible by their individual digits, but not by the product of their digits.: Difference between revisions
Numbers divisible by their individual digits, but not by the product of their digits. (view source)
Revision as of 22:27, 18 April 2021
, 3 years ago→{{header|Phix}}
Not a robot (talk | contribs) (Add PL/M) |
|||
Line 640:
936
999</pre>
=={{header|Perl}}==
<lang perl>#!/usr/bin/perl
use strict;
use warnings;
my @numbers = grep
{
my $n = $_;
! /0/ and $_ % eval s/\B/*/gr and 0 == grep $n % $_, split //
} 1 .. 999;
print @numbers . " numbers found\n\n@numbers\n" =~ s/.{25}\K /\n/gr;</lang>
{{out}}
<pre>
45 numbers found
22 33 44 48 55 66 77 88 99
122 124 126 155 162 168 184
222 244 248 264 288 324 333
336 366 396 412 424 444 448
488 515 555 636 648 666 728
777 784 824 848 864 888 936
999
</pre>
=={{header|Phix}}==
|