Anonymous user
Show the (decimal) value of a number of 1s appended with a 3, then squared: Difference between revisions
Show the (decimal) value of a number of 1s appended with a 3, then squared (view source)
Revision as of 16:31, 15 April 2021
, 3 years ago→{{header|Phix}}
m (→{{header|Haskell}}: Applied Hlint, Ormolu) |
|||
Line 377:
1111113 1234572098769
11111113 123456832098769
</pre>
=={{header|Perl}}==
<lang perl>#!/usr/bin/perl
use strict; # https://rosettacode.org/wiki/Show_the_(decimal)_value_of_a_number_of_1s_appended_with_a_3,_then_squared
use warnings;
#use bignum; # uncomment for larger than 9 or 32-bit perls
for ( 0 .. 7 )
{
my $number = 1 x $_ . 3;
print "$number ", $number ** 2, "\n";
}</lang>
{{out}}
<pre>
3 9
13 169
113 12769
1113 1238769
11113 123498769
111113 12346098769
1111113 1234572098769
11111113 123456832098769
</pre>
|