RaFaL Pocztarski wrote:
> Chris Spurgeon wrote:
>
> > (...) It strikes me that this
> > could have been more elegantly done with some sort of recursive function,
> > but I couldn't figure out how. Any ideas?
>
> (...) And now, my suggestion:
>
> 8<8<
> #!/usr/bin/perl -w
>
> my $
Chris Spurgeon wrote:
> I was asked to figure out all of the different ways you can add up various
> combinations of the digits 1 through 9 to create different totals. For
> instance, you can get 8 by adding 1+7 or 2+5 or 3+4 or 1+2+4 (for each
> addition, each numeral can only be used once.) I
At 17:29 08/10/01, Chris wrote:
>I was asked to figure out all of the different ways you can add up various
>combinations of the digits 1 through 9 to create different totals. For
>instance, you can get 8 by adding 1+7 or 2+5 or 3+4 or 1+2+4 (for each
>addition, each numeral can only be used once.
I was asked to figure out all of the different ways you can add up various
combinations of the digits 1 through 9 to create different totals. For
instance, you can get 8 by adding 1+7 or 2+5 or 3+4 or 1+2+4 (for each
addition, each numeral can only be used once.) I wrote this code to
generate all