11 lines
227 B
Text
11 lines
227 B
Text
>function Doors () ...
|
|
$ doors:=zeros(1,100);
|
|
$ for i=1 to 100
|
|
$ for j=i to 100 step i
|
|
$ doors[j]=!doors[j];
|
|
$ end;
|
|
$ end;
|
|
$ return doors
|
|
$endfunction
|
|
>nonzeros(Doors())
|
|
[ 1 4 9 16 25 36 49 64 81 100 ]
|