|  | 
|  | 
| вернуться в форум | why acces violation in #17 Послано Sahil  9 ноя 2008 00:26varmax,ll,o,i,j,l,m,n:longint;
 k:real;
 b,a:array[1..1000] of real;
 begin
 readln(n);
 for i:=1 to n do
 begin
 read(k);
 j:=j+1;
 a[j]:=trunc(k);
 end;
 J:=0;
 repeat
 j:=j+1;
 for i:=1 to n do
 if a[j]=a[i] then  l:=l+1;
 o:=o+1; b[o]:=l;
 l:=0;
 until j=n;
 max:=trunc(b[1]);
 ll:=1;
 for i:=1 to o do
 if b[i]>max then begin max:=trunc(b[i]);ll:=i; end;
 
 write(a[ll]);
 end.
Re: why acces violation in #17 b,a:array[1..1000] of real!!increase the size from 1000 to 100000.
 But now with this correction TLE
 | 
 | 
|