| ||||||||||
| 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 | |||||||||
为什么会Runtime Error??var
i,j,k,x,y:integer;
n,m,max,m1,m2:integer;
a:array[1..1000,1..1000]of integer;
point,arr:array[1..1000]of integer;
begin
readln(n,m);
while not((n=0)and(m=0)) do begin
fillchar(a,sizeof(a),0);
fillchar(arr,sizeof(arr),0);
fillchar(point,sizeof(point),0);
max:=0;
m1:=1;
m2:=0;
for i:= 1 to n do
for j:= 1 to m do begin
read(a[i,j]);
if a[i,j]>max then max:=a[i,j];
inc(point[a[i,j]]);
end;
for i:= 1 to max do
if point[i]>0 then begin
if point[i]>m1 then begin
m2:=m1;
m1:=point[i];
end
else
if (point[i]>m2)and(point[i]<m1) then m2:=point[i];
end;
k:=0;
for i:= 1 to max do
if point[i]=m2 then begin
inc(k);
arr[k]:=i;
end;
for i:= 1 to k do
write(arr[i],' ');
readln(n,m);
end;
end.
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator