Ответ:
var
i, n, x, max:integer;
begin
max := -1001;
read(n); // Количество вводимых чисел
for i := 1 to n do begin
read(x); // Ввод чисел
if(x mod 2 = 0) and (x > max) then
max := x;
end;
if(max = -1001) then
write(0)
else
write(max);
end.
===== PascalABC.NET =====
ReadSeqInteger(ReadInteger('n ='))
.Where(p -> p.IsEven)
.DefaultIfEmpty
.Max
.Print
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
var
i, n, x, max:integer;
begin
max := -1001;
read(n); // Количество вводимых чисел
for i := 1 to n do begin
read(x); // Ввод чисел
if(x mod 2 = 0) and (x > max) then
max := x;
end;
if(max = -1001) then
write(0)
else
write(max);
end.
===== PascalABC.NET =====
begin
ReadSeqInteger(ReadInteger('n ='))
.Where(p -> p.IsEven)
.DefaultIfEmpty
.Max
.Print
end.