Descending primes: Difference between revisions
Content added Content deleted
(Nim solution.) |
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: code layout) |
||
Line 848: | Line 848: | ||
=={{header|Perl}}== |
=={{header|Perl}}== |
||
{{libheader|ntheory}} |
|||
<syntaxhighlight lang="perl"> |
<syntaxhighlight lang="perl"> |
||
use strict; |
|||
use strict; # https://rosettacode.org/wiki/Descending_primes |
|||
use warnings; |
use warnings; |
||
use ntheory |
use ntheory 'is_prime'; |
||
print join( '', |
|||
⚫ | |||
sort |
|||
⚫ | |||
map { sprintf '%9d', $_ } |
|||
⚫ | |||
⚫ | |||
) =~ s/.{45}\K/\n/gr; |
|||
</syntaxhighlight> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |