RosettaCodeData/Task/Greatest-subsequential-sum/Euler-Math-Toolbox/greatest-subsequential-sum-3.euler
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

8 lines
214 B
Text

>function test ...
$ loop 1 to 10000000
$ v=intrandom(1,intrandom(6)+6,20)-10;
$ if sum(maxsubs(v))!=sum(maxsubsbrute(v)) then
$ v, error("Found a wrong test example");
$ endif;
$ endfunction
>test