Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么会Runtime Error??

Posted by SPCD at 2010-03-20 20:33:34 on Problem 2092 and last updated at 2010-03-20 20:40:19
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator