var
n : integer;
S : decimal;
function fac(n : integer) : decimal;
begin
result := 1;
for var i := 1 to n do result := result * i;
end;
write('введите n = ');
readln(n);
for var i := 1 to n do S := S+fac(i);
writeln('S=', S);
end.
var
n : integer;
S : decimal;
function fac(n : integer) : decimal;
begin
result := 1;
for var i := 1 to n do result := result * i;
end;
begin
write('введите n = ');
readln(n);
for var i := 1 to n do S := S+fac(i);
writeln('S=', S);
end.