题目是求中位数
var
c,d,x,n:longint;
mid:real;
a:array[1..500000]of longint;
procedure qsort(l,r:longint);
var i,j,m,t:longint;
begin
i:=l;j:=r;m:=a[(l+r)div 2];
repeat
while a[i]<m do inc(i);
while a[j]>m do dec(j);
if i<=j then
begin t:=a[i];a[i]:=a[j];a[j]:=t;inc(i);dec(j);end;
until i>j;
if l<j then qsort(l,j);
if i<r then qsort(i,r);
end;
begin
assign(input,'redian.in');reset(input);
assign(output,'redian.out');rewrite(output);
readln(n);
for x:=1 to n do read(a[x]);
qsort(a[x]);
case (n mod 2) of
0:begin c:=(n div 2);d:=c+1;mid:=(a[c]+a[d])/2;end;
1:begin n:=(n div 2 )+1;mid:=a[n];end;
end;
write(mid:1);
close(input);close(output);
end.
主程序里的qsort(a[x]);哪错了
Error: Wrong number of parameters specified for call to "qsort"
var
c,d,x,n:longint;
mid:real;
a:array[1..500000]of longint;
procedure qsort(l,r:longint);
var i,j,m,t:longint;
begin
i:=l;j:=r;m:=a[(l+r)div 2];
repeat
while a[i]<m do inc(i);
while a[j]>m do dec(j);
if i<=j then
begin t:=a[i];a[i]:=a[j];a[j]:=t;inc(i);dec(j);end;
until i>j;
if l<j then qsort(l,j);
if i<r then qsort(i,r);
end;
begin
assign(input,'redian.in');reset(input);
assign(output,'redian.out');rewrite(output);
readln(n);
for x:=1 to n do read(a[x]);
qsort(a[x]);
case (n mod 2) of
0:begin c:=(n div 2);d:=c+1;mid:=(a[c]+a[d])/2;end;
1:begin n:=(n div 2 )+1;mid:=a[n];end;
end;
write(mid:1);
close(input);close(output);
end.
主程序里的qsort(a[x]);哪错了
Error: Wrong number of parameters specified for call to "qsort"