Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: splitting a number into several numbers

by dwatson06 (Friar)
on Jul 05, 2002 at 18:11 UTC ( #179698=note: print w/ replies, xml ) Need Help??

in reply to splitting a number into several numbers

If this is input by the user and you will not know how many numbers will be coming in...
You can grab the length of the input...
half it...
do a loop using the value...
then just grab substrings by an increment of twos.
Of course you will need to make sure the number coming in is even then handle other conditions on the odds.
Hope this helps.

Comment on Re: splitting a number into several numbers

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2015-10-09 16:59 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (247 votes), past polls