|
|
back to boardWhy Compilation error? var t: real; n, k, i,j: integer; a:array [1..101] of integer; begin readln(n); for i := 1 to n do begin read(a[i]); end; for i:=1 to n do begin for j:=1 to n do begin if a[i]<a[j] then begin swap(a[i],a[j]); end; end; end;
for i:=1 to (n div 2)+1 do begin t:=t+((a[i] div 2)+1); end;
write(t); end. Re: Why Compilation error? Pascal hasn't function swap. You should to write it yourself |
|
|