Sum multiples of 3 and 5: Difference between revisions
m
→{{header|Perl}}: 2nd example needed integer results from division
m (Added Crystal solution - pre extra credits.) |
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: 2nd example needed integer results from division) |
||
Line 2,242:
{{Trans|Tcl}}
An alternative approach, using the analytical solution from the Tcl example.
<lang Perl>
sub tri
{
my $n = shift;
Line 2,251 ⟶ 2,252:
{
my $n = (shift) - 1;
}
|