. Pmin, n . - n [n]. n>2, [n] (n-1) . . n=2, . , Pmin, . Min, .
Program Example _1;
Const n=10;
Type MyArray=Array[1..n] of Integer;
Const a : MyArray = (4,2, -1,5,2,9,4,8,5,3);
Function Min (a, b : Integer) : Integer;
Begin
if a>b then Min := b else Min:=a;
End;
Function Pmin(n, b : Integer) : Integer;
Begin
if n = 2 then Pmin := Min(n,a[1]) else Pmin := Min(a[n], Pmin(n-1,a[n]));
End;
BEGIN
Writeln( - , Pmin(n,a[n]));
END.
Program Example_2;
Const k = 3;
Var a,b,c : Char;
Procedure Disk(n : Integer; a, b, c: Char);
Begin
if n>0 then
begin
Disk(n-1,a,c,b);
Writeln( ,n, c , a,->, b);
Disk(n-1,c,b,a);
end;
End;
BEGIN
a := A; b := B; c := C;
Disk(k,a,b,c);
ReadLn;
END.