var
A: array [1..5] of Integer;
i, s: Integer;
begin
WriteLn ('Массив:');
s := 0;
Randomize;
for i := 1 to 5 do begin
A [i] := Random (10);
WriteLn (i, ': ', A [i]);
if A [i] in [8, 2, 4] then
s := s + A [i];
end;
WriteLn ('Сумма элементов 8, 2, 4 = ', s);
end.