var
a, b, p, i:integer;
Begin
p:= 0;
write('Введите a: ');
readln(a);
write('Введите b: ');
readln(b);
if (a < 0) and (b < 0) then
for i:=1 to Abs(b) do
p:= p + Abs(a)
else if ((a < 0) and (b >= 0)) or ((a >= 0) and (b < 0)) then begin
for i:=1 to Abs(b) do
p:= p + Abs(a);
p:= p * -1;
end
else
for i:=1 to b do
p:= p + a;
writeln('Произведение: ', p);
END.