#!/usr/bin/perl 'As I was going to St. Ives', 'I met a man with seven wives', 'Each wife had seven sacks', 'Each sack had seven cats', 'Each cat had seven kits', 'Kits, cats, sacks, and wives', 'How many were going to St. Ives'? how_many: do { $wives = 7; $how_many = $wives; $sacks = 7; $how_many += $wives * $sacks; $cats = 7; $how_many += $wives * $sacks * $cats; $kits = 7; $how_many += $wives * $sacks * $cats * $kits; }; print int $how_many;
Update: for those interested in declaring the answer is 0, 1, 2800, or "who knows", here's a link discussing the relative merits of this riddle and some possible answers.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: St. Ives
by cLive ;-) (Prior) on Dec 22, 2003 at 16:58 UTC | |
by duff (Parson) on Dec 22, 2003 at 17:06 UTC | |
|
Re: St. Ives
by duff (Parson) on Dec 22, 2003 at 17:04 UTC | |
by delirium (Chaplain) on Dec 22, 2003 at 17:19 UTC | |
by duff (Parson) on Dec 22, 2003 at 19:18 UTC |