|
|
вернуться в форумI don't know where is wrong. ( Pascal ) Wrote on Pascal: var i, j: integer; ms, a, b: integer; arrg: array of integer; begin Read(ms); SetLength(arrg, ms);
for i := 0 to arrg.Length - 1 do begin var temp: integer; Read(temp); arrg[i] := temp; end;
for j := 1 to arrg.Length - 1 do for i := 1 to arrg.Length - j do if arrg[i - 1] > arrg[i] then Swap(arrg[i - 1], arrg[i]);
a := arrg.Length div 2;
for i := 0 to a do b := b + arrg[i] div 2 + 1;
Write(b); end. Wrong answer ( test 1 ). Re: I don't know where is wrong. ( Pascal ) Послано German 14 окт 2016 22:41 arrg.Length it may be odd |
|
|