// №1 а)
function Fact(n:integer):integer;
var
rez, i:integer;
begin
rez := 1;
for i := 1 to n do
rez := rez * i;
Fact := rez;
end;
function Pow(a, x:integer):integer;
for i := 1 to x do
rez := rez * a;
Pow := rez;
n, i:integer;
R:real;
r := 0;
write('n = '); readln(n);
r := r + Pow(-1, i mod 2) * (i + 1) / Fact(i);
writeln('R = ', r);
end.
// №1 б)
function Summ(n:integer):real;
i:integer;
rez:real;
for i := 2 to n do
rez := rez + 1/i;
Summ := rez;
r := r + Fact(i)/Summ(i);
// №2 а)
function Pow(a:real; x:integer):real;
R, x:real;
write('x = '); readln(x);
r := r + Pow(x, i) / Fact(i);
// №2 б)
r := 1;
r := r * (i / (i + 1) - Pow(cos(x), i)) ;
// №1 а)
function Fact(n:integer):integer;
var
rez, i:integer;
begin
rez := 1;
for i := 1 to n do
rez := rez * i;
Fact := rez;
end;
function Pow(a, x:integer):integer;
var
rez, i:integer;
begin
rez := 1;
for i := 1 to x do
rez := rez * a;
Pow := rez;
end;
var
n, i:integer;
R:real;
begin
r := 0;
write('n = '); readln(n);
for i := 1 to n do
begin
r := r + Pow(-1, i mod 2) * (i + 1) / Fact(i);
end;
writeln('R = ', r);
end.
// №1 б)
function Fact(n:integer):integer;
var
rez, i:integer;
begin
rez := 1;
for i := 1 to n do
rez := rez * i;
Fact := rez;
end;
function Summ(n:integer):real;
var
i:integer;
rez:real;
begin
rez := 1;
for i := 2 to n do
rez := rez + 1/i;
Summ := rez;
end;
var
n, i:integer;
R:real;
begin
r := 0;
write('n = '); readln(n);
for i := 1 to n do
begin
r := r + Fact(i)/Summ(i);
end;
writeln('R = ', r);
end.
// №2 а)
function Fact(n:integer):integer;
var
rez, i:integer;
begin
rez := 1;
for i := 1 to n do
rez := rez * i;
Fact := rez;
end;
function Pow(a:real; x:integer):real;
var
i:integer;
rez:real;
begin
rez := 1;
for i := 1 to x do
rez := rez * a;
Pow := rez;
end;
var
n, i:integer;
R, x:real;
begin
r := 0;
write('n = '); readln(n);
write('x = '); readln(x);
for i := 1 to n do
begin
r := r + Pow(x, i) / Fact(i);
end;
writeln('R = ', r);
end.
// №2 б)
function Pow(a:real; x:integer):real;
var
i:integer;
rez:real;
begin
rez := 1;
for i := 1 to x do
rez := rez * a;
Pow := rez;
end;
var
n, i:integer;
R, x:real;
begin
r := 1;
write('n = '); readln(n);
write('x = '); readln(x);
for i := 1 to n do
begin
r := r * (i / (i + 1) - Pow(cos(x), i)) ;
end;
writeln('R = ', r);
end.