|
|
back to boardCommon BoardWhere is wrong-1086 var i, k, j, s, n, l:longint; bool:boolean; a:array [1..1000] of integer; p:array [1..15000] of longint; begin Read (n); for i:= 1 to n do Readln (a [i]); s:=1; for i:= 2 to n do if a [s] < a [i] then s:=i; i:=3; k:=1; p [1]:=2; if a [s] <> 1 then repeat bool:=true; for j:=1 to (trunc (sqrt (i)) div 2) do if (i mod (2*j+1)) = 0 then begin bool:=false; break; end; if bool then begin inc (k); p [k]:=i; end; inc (i, 2); until (k=a [s]); for i:= 1 to n do write (p [a [i]], ' '); end. |
|
|