Const nn=100; var A,C:array[1..nn] of integer; i,k,n:integer; begin Write('n='); Read(n); k:=0; for i:=1 to n do begin Read(a[i]); if i mod 3=0 then begin k:=k+1; c[k]:=a[i] end end; Write('C[',k,']= '); for i:=1 to k do Write(c[i],' '); Writeln end.
nn=100;
var
A,C:array[1..nn] of integer;
i,k,n:integer;
begin
Write('n='); Read(n);
k:=0;
for i:=1 to n do begin
Read(a[i]);
if i mod 3=0 then begin
k:=k+1; c[k]:=a[i]
end
end;
Write('C[',k,']= ');
for i:=1 to k do Write(c[i],' ');
Writeln
end.
Пример
n=10
3 18 -6 14 21 42 15 28 -7 12
C[3]= -6 42 -7