Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Cube/digit script.

by perlsen (Chaplain)
on Mar 10, 2006 at 14:23 UTC ( [id://535707]=note: print w/replies, xml ) Need Help??


in reply to Cube/digit script.

Hi Andrew,
I have rewritten your script(same as yours),
I am not sure whether my output is correct or not,
I just tried to get the output Result, What you are trying now
I hope this might help
use strict; use warnings; my ($i,$j,$l,$s); my (@num,@numbers); for $i(100..999) { undef(@num); @num=split(//, $i); foreach $j(@num){ $j=$j**3;} $s=0; for $l(@num) {$s = $s + $l;} if( $s == "$i") {push (@numbers, $i);} } print @numbers; #output is 153370371407

Thanks,
perlsen
UPDATE:
This script was written by me to produce the output for your program only.
I am not clearly go through your script.
Any way, This is waste of my precious time.
and Thanks for some fellow monks good response.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://535707]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-20 02:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found