begin Randomize; Writeln('Элементы массива, кратные трем:'); s := 0; for i := 1 to n do begin a[i] := Random(301)-150; if (a[i] mod 3)=0 then Write(a[i],' '); if a[i]>0 then s:=s+a[i] end; Writeln; Writeln('Сумма положительных элементов равна ',s) end.
var
totalCount, count, num: integer;
begin
totalCount := -1; count := 0; num := -1;
repeat
totalCount := totalCount + 1;
if (num mod 5 = 0) then count := count + 1;
read(num);
until (num = 0);
write((count * 100) / totalCount, '%');
end.