uses crt var ch max char counts array of integer begin for ch to do be

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
uses crt;
var
ch, max :char;
counts :array ['0'..'9'] of integer;
begin
for ch := '0' to '9' do begin
counts[ch] := 0;
end;
writeln('Vvodite > ');
while (true) do begin
read(ch);
if (ch = '.') then begin
break;
end;
counts[ch] := counts[ch] + 1;
end;
max := '0';
for ch := '1' to '9' do begin
if (counts[ch] > counts[max]) then begin
max := ch;
end;
end;
writeln(max);
readln;
end.