- or download this
{$s=eval join'+',@d=grep!($n%$_),1..
...
die;my$t=pop||die'!';eval{w(@_,$s-$t
)},$@=~/!/||die if$t<=$s;w(@_,$s)}
- or download this
{
...
w( @_, $s)
}
- or download this
{
...
redo
}
- or download this
sub w{
...
w( @_, $s)
}
- or download this
w(1,2,3,4,6, 12);
...
w(1,2, 2);
die (2 == 2), therefore 12 is semiperfect
- or download this
w(1,7,11,14,18, 21)
...
# 7 <= 7, subtract it from 7, continue
w(1, 0) #pops off the sum, which is 0 in this case, so we've s
+ucceeded. "die" with no bang -> success!