begin Write('Enter the number of integers: '); ReadLn(n);
Write('Enter ', n, ' integers: '); ReadLn(number); if number mod 5 = 0 then maxMultipleOfFive := number else maxMultipleOfFive := 0;
for i := 2 to n do begin ReadLn(number); if (number mod 5 = 0) and (number > maxMultipleOfFive) then maxMultipleOfFive := number; end;
if maxMultipleOfFive = 0 then WriteLn('There are no multiples of 5 in the entered numbers.') else WriteLn('The maximum number divisible by 5 is: ', maxMultipleOfFive); end.
program MaxMultipleOfFive;
var
n, i, number, maxMultipleOfFive: integer;
begin
Write('Enter the number of integers: ');
ReadLn(n);
Write('Enter ', n, ' integers: ');
ReadLn(number);
if number mod 5 = 0 then
maxMultipleOfFive := number
else
maxMultipleOfFive := 0;
for i := 2 to n do
begin
ReadLn(number);
if (number mod 5 = 0) and (number > maxMultipleOfFive) then
maxMultipleOfFive := number;
end;
if maxMultipleOfFive = 0 then
WriteLn('There are no multiples of 5 in the entered numbers.')
else
WriteLn('The maximum number divisible by 5 is: ', maxMultipleOfFive);
end.