.



1

1

Program Task1;

uses WinCrt;

var

p : longint;

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

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

var

i : integer;

begin

r := 1;

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

end;

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

begin

placement(40, 3, p);

writeln(' ', p)

end.

2

Program Task1_2;

uses WinCrt;

var

s, r1, r2, r3 : longint;

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

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

var

i : integer;

begin

r := 1;

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

end;

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

begin

placement(5, 1, r1);

placement(5, 2, r2);

placement(5, 3, r3);

s := r1 + r2 + r3;

writeln(' . ');

writeln(' 1, 2, 3, 4, 5; ', s, ' ')

end.

2

1

Program Task2_1;

uses WinCrt;

var

p1, p2, p : longint;

m, n : integer;

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

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

var

i : integer;

begin

r := 1;

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

end;

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

begin

write(' '); readln(m);

write(' '); readln(n);

placement(m, n, p1);




- -  - -  - -