Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I spent the day wondering how they can do that when people request "I want X phone numbers and I want them consecutive.". How could you have a program that asks for the number of numbers you want back from a list that are consecutive phone numbers (or ANY numbers since this isn't something that will be applied, it's just an interesting thing I was wondering) and display then for you?
my @array = (1,5,6,7,8,55,63,77,89,103,104,105,106,200,215,554);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Consecutive number checking
by Zaxo (Archbishop) on Jul 04, 2004 at 06:51 UTC | |
|
Re: Consecutive number checking
by gaal (Parson) on Jul 04, 2004 at 06:25 UTC | |
|
Re: Consecutive number checking
by beable (Friar) on Jul 04, 2004 at 06:15 UTC | |
|
Re: Consecutive number checking
by davido (Cardinal) on Jul 04, 2004 at 06:55 UTC | |
|
Re: Consecutive number checking
by Anonymous Monk on Jul 04, 2004 at 16:35 UTC |