|
|
back to boardwa2 why? Posted by Pk.95 25 Dec 2010 00:13 program Project2; {$APPTYPE CONSOLE} uses SysUtils; var k,i,j,min:byte; t:Word; nas:array of Word; begin read(k); if k = 1 then begin read(t); write((t+1)div 2); exit; end; SetLength(nas,k+1); for i:=1 to k do read(nas[i]); for i:=1 to k-1 do begin min:=i; for j:=i+1 to k do if nas[j] < nas[min] then min:=j; t:=nas[i]; nas[i]:=nas[min]; nas[min]:=t; end; write((nas[1]+1) div 2 + (nas[2]+1)div 2); end. |
|
|