program v1l10z1 var integer sum real function znak integer begin if mo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
program v1l10z1;
var
k,m,p,x:integer;
sum:real;
function znak:integer;
begin
if (k mod 2)=0 then
znak:=1
else
znak:=-1
end;
function xstepk:real;
var
i,y:integer;
begin
y:=x;
for i:=2 to k do
y:=y*x;
xstepk:=y
end;
function kfakt:integer;
var
i,xf:integer;
begin
xf:=1;
for i:=1 to k do
xf:=xf*i;
kfakt:=xf
end;
begin
sum:=0;
write ('M='); readln (m);
write ('P='); readln (p);
write ('X='); readln (x);
for k:=m to p do
sum:=sum+(znak*(xstepk/kfakt));
writeln (sum:6:8);
readln
end.