Sum and product puzzle: Difference between revisions

m
→‎version 5, fast: added a message if there wasn't a solution found.
m (→‎version 5, fast: simplified some code, split a long line, optimized search.)
m (→‎version 5, fast: added a message if there wasn't a solution found.)
Line 2,766:
if C2(m * (s-m)) then do; if $>0 then iterate s; $= m; end
end /*m*/
if $>0 then say "'The numbers are: "' $ " and " s-$
end /*s*/
if $==0 then say 'No solution found.'
exit 0 /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/