program
ex8(input, output)
var i,j,k,s:integer
begin
for i :=3 downto 1 do
begin
for j :=1 to 3 do
begin
k:=0;
repeat k:=k+1 ;s:=s+k;
until k=j;
end;
s:=s-(k+1);
end;
write ('s=',s);
end.
program
ex8(input, output)
var i,j,k,s:integer
begin
for i :=3 downto 1 do
begin
for j :=1 to 3 do
begin
k:=0;
repeat k:=k+1 ;s:=s+k;
until k=j;
end;
s:=s-(k+1);
end;
write ('s=',s);
end.