|
|
вернуться в форумWhy I got Memory Limit ? Please Help me! Послано nr 13 ноя 2002 13:33 program nn; const hs='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; var a:array[0..37]of longint; b:array[0..37]of boolean; K,J,KK,MAX:LONGINT; C:CHAR; PROCEDURE SOLVE; begin J:=POS(C,HS); IF J=0 THEN BEGIN FOR K:=2 TO 36 DO B[K]:=TRUE; EXIT; END; for k:=2 TO 36 DO BEGIN IF J>K THEN B[K]:=TRUE ELSE BEGIN IF B[K] THEN BEGIN INC(A[K]); B[K]:=FALSE; END ELSE B[K]:=FALSE; END; END; end; begin fillchar(a,sizeof(a),0); fillchar(B,SIZEOF(b),TRUE); while not eof do begin read(c); solve; end; MAX:=-1; FOR K:=2 TO 36 DO IF A[K]>MAX THEN BEGIN MAX:=A[K]; KK:=K; END; WRITELN(KK,' ',MAX); end. |
|
|