var a:array[1..7]of integer;i,s:integer;beginfor i:=1 to 7 do begin a[i]:=random(9)+1; s:=s+a[i]; end;for i:=1 to 7 do write(a[i],' ');writeln;for i:=1 to 7 do if a[i] mod 3=0 then a[i]:=s;for i:=1 to 7 do write(a[i],' ');end.
var a:array[1..7]of integer;
i,s:integer;
begin
for i:=1 to 7 do begin a[i]:=random(9)+1; s:=s+a[i]; end;
for i:=1 to 7 do write(a[i],' ');
writeln;
for i:=1 to 7 do if a[i] mod 3=0 then a[i]:=s;
for i:=1 to 7 do write(a[i],' ');
end.