Const n=15;
var a:array[1..n] of integer;
i,s:integer;
begin
Randomize;
for i:=1 to n do
begin
a[i]:=random(50);
write(a[i]:4);
end;
writeln;
s:=0;
for i:=1 to n div 3 do s:=s+a[3*i];
writeln('s = ',s);
end.
Пример:
31 6 10 5 46 13 32 30 41 25 16 36 2 3 4
s = 104