Grrrr - after I posted I finished reading japhy's post where he provided an even more succinct solution.#!/usr/bin/perl use strict; use warnings; use List::Util 'sum'; for (100 .. 999) { print "$_\n" if sum(map {$_ ** 3} split //) == $_; }
Cheers - L~R
In reply to Re: Cube/digit script.
by Limbic~Region
in thread Cube/digit script.
by Andrew_Levenson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |