|
|
вернуться в форумWhy wrong answer??????? Послано Misha 12 мар 2003 18:48 Why wrong answer??????? Type Vector = array [1..101] of Integer; Var a: Vector; k,i,u,min,R,p,o : Integer; Begin Readln (k); For i:=1 to k do Read (a[i]); u:=1; while (u<=k) do begin min:=a[u]; for i:=u to k do if a[i]<min then begin min:=a[i]; p:=i; end; R:=a[u]; a[u]:=min; a[p]:=R; u:=u+1; end; k:=k div 2+1; o:=0; for i:=1 to k do begin a[i]:=round(a[i]/2); o:=o+a[i]; end; write (o); end. Re: Why wrong answer??????? Послано Saber 12 мар 2003 19:44 use Div 2 instead of round ... |
|
|