//1
var fin,fout:text;
i,sum,x:real;
begin
assign(fin,'C:\in.txt');
assign(fout,'C:\out.txt');
Reset(fin);
while not eof(fin) do begin
readln(fin,x);
sum:=sum+x;
i:=i+1;
end;
close(fin);
x:=sum/i;
Rewrite(fout);
write(fout,x);
close(fout);
end.
//2
var fin,fout:text;
max,min,x:integer;
begin
assign(fin,'C:\in.txt');
assign(fout,'C:\out.txt');
Reset(fin);
min:=100;
while not eof(fin) do begin
read(fin,x);
if (x>0) and (x mod 2=0) then begin
if x>max then max:=x;
if x<min then min:=x;
end;
end;
close(fin);
Rewrite(fout);
if (min>max) then write(fout,'Ошибка')
else write(fout,'Максимальное: ',max,' Минимальное: ',min);
close(fout);
end.
//3
var fin,fout:text;
d,x,i,y:integer;
begin
assign(fin,'C:\in.txt');
assign(fout,'C:\out.txt');
reset(fin);
while not eof(fin) do begin
readln(fin, x);
if (i=0) or (x=y) then i:=i+1
else i:=1;
if (i>d) then d:=i;
y:=x;
end;
close(fin);
rewrite(fout);
writeln(fout, 'Самая длинная цепочка: ', d);
close(fout);
end.