const
n = 15;
a: array[1 .. n] of integer =
(1, 4, 5, 3, 6, 5, 2, 9, 7, 4, 3, 7, 9, 13, 23);
var
s, i: integer;
begin
s := 0;
writeln('Исходный массив:')
for i := 1 to n do
write(a[i]:4);
writeln;
for i := 1 to n do
if i mod 3 = 0 then
a[i] := 0
else inc(s, a[i]);
writeln('Переформированный массив:')
for i := 1 to n do
write(a[i]:4);
writeln;
writeln( 's = ', s );
end.