.


- 3


i :=1 to n do f := f*i

end;

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

begin

Factorial(9, s); Factorial(4, k1);

Factorial(3, k2); Factorial(2, k3);

s := s div (k1*k2*k3);

writeln(' ', s, ' ')

end.

5

1

Program Task5_1;

uses WinCrt;

var

i : longint;

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

Procedure Combination(n, k : integer; var c : longint);

var

i : longint;

begin

c := 1;

for i := 1 to k do

c := c*(n - k + i) div i

end;

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

begin

combination(28, 2, i);

write(' 30 , 2 , ');

writeln(' 4');

write(', 2 , ');

writeln(i,' ')

end.

 

2

 

Program Task5_2;

uses WinCrt;

var

w, b, r : longint;

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

Procedure Combination(n, k : integer; var c : longint);

var

i : longint;

begin

c := 1;

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

end;

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

begin

combination(5, 3, w);

combination(97, 2, b);

r := w*b;

writeln('3 5, ');

writeln(' 100 , 5 , ', r, ' ')

end.

6

Program Task6_1;

uses WinCrt;

var

s, j, s1 : longint;

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

Procedure Combination(n, k : integer; var




- -  - -  - -