.


- 2


placement(m - 1, n - 1, p2);

p := p1 - p2;

writeln(' ', m, ' ', n, ',');

writeln(' . , ', p)

end.

2

Program Task2_2;

uses WinCrt;

var

p1, p2, p : longint;

m, n, k : integer;

{----------------------------------------------------------------------------------------}

Procedure placement(n, k : integer; var r : longint);

var

i : integer;

begin

r := 1;

for i := 1 to k do r := r*(n - i + 1)

end;

{----------------------------------------------------------------------------------------}

begin

placement(7, 1, p1);

placement(9, 6, p2);

p := p1*p2;

writeln(' 10 7, ');

writeln(' 1- , ', p)

end.

3

 

Program Task3_1;

uses WinCrt;

var

z, z1 : longint;

{----------------------------------------------------------------------------------------}

Procedure Factorial(n : integer; var f : longint);

var

i : longint;

begin

f := 1;

if n=0 then f := 1 else for i := 1 to n do f := f*i

end;

{----------------------------------------------------------------------------------------}

begin

Factorial(4, z); z := 2*z; Factorial(3, z1); z := z - z1;

writeln(' ', z, ' , ');

writeln(' 5, 0, 1, 2, 3, 5')

end.

4

Program Task4_1;

uses WinCrt;

var

s, k1, k2, k3 : longint;

{----------------------------------------------------------------------------------------}

Procedure Factorial(n : integer; var f : longint);

var

i : integer;

begin

f := 1;

if n = 0 then f := 1 else for




- -  - -  - -