08.12.2010, 17:59
|
|
Начинающий
|
|
Регистрация: 08.09.2008
Сообщения: 193
Репутация: 12694
|
|
Код:
var
count, n, best: integer;
iq: array of integer;
f: TextFile;
begin
AssignFile(f, 'input.txt');
Reset(f);
SetLength(iq, 32001);
for n := 0 to 32000 do
iq[n] := 0;
count := 0;
while not Eof(f) do
begin
Readln(f, n);
inc(iq[n]);
inc(count);
end;
CloseFile(f);
count := count div 2;
best := 0;
for n := 0 to 32000 do
if iq[n] >= count then
if iq[n] > best then
best := iq[n];
AssignFile(f, 'output.txt');
Rewrite(f);
if best <> 0 then
Writeln(f, best)
else
Writeln(f, 'НЕТ РЕШЕНИЯ');
CloseFile(f);
Readln;
end.
|