| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
大家帮我找找错误Pascal请大家找找怎么错了,两组数据都对的,但显示Runtime Error:
const max=1000000;
var n,j:integer;
a:array[1..1000] of real;
b:array[1..1000] of integer;
i:integer;
procedure qsort(i,j:integer);
var
temp:real;
x,y:integer;
si,fst:boolean;
begin
if j<i then exit;
x:=i;
y:=j+1;
temp:=a[i];
while x<>y do begin
repeat
dec(y);
until (a[y]<temp)or(a[x]=a[y]);
a[x]:=a[y];
if x<>y Then Begin
repeat
inc(x);
until (a[x]>temp)or(a[x]=a[y]);
a[y]:=a[x];
end;
end;
a[x]:=temp;
qsort(i,x-1);
qsort(x+1,j);
end;
begin
readln(n);
while (n<>0) do begin
fillchar(a,sizeof(a),0);
i:=0;
repeat
i:=i+1;
read(a[i]);
read(b[i]);
if not((a[i]<=0) or (b[i]<0)) then a[i]:=4.5/a[i]*3600+b[i] else
a[i]:=max;
until i=n;
qsort(1,n);
if trunc(a[1])=a[1] then writeln(trunc(a[1])) else
writeln(trunc(a[1])+1);
readln(n);
end;
end.
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator