why I got WA?
Posted by
qwt 13 May 2002 19:58
var
a:array[0..1000,1..3] of real;
x,y,x0,y0:real;
n,i,j,k:integer;
begin
readln(x0,y0);
readln(n);
fillchar(a,sizeof(A),0);
for i:=1 to n do begin
readln(x,y,a[i,3]);
x:=x-x0;y:=y-y0;
a[i,1]:=x;a[i,2]:=y;
end;
for i:=1 to n-1 do for j:=i+1 to n do if a[i,1]*a[j,2]-a[i,2]*a[j,1]
>0 then begin
a[0]:=a[i];a[i]:=a[j];a[j]:=a[0];
end;
writeln(0);
for i:=1 to n do begin
writeln(a[i,3]:0:0);
end;
writeln(0);
end.