.


- 5


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

Function Sum_sgr(a : integer) : integer;

var

s, p : integer;

begin

s := 0;

repeat

p := a mod 10;

s := s + p*p; a := a div 10

until a = 0;

Sum_sgr := s

end;

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

Function Succ(a, n : integer) : integer;

var

i : integer;

begin

if n > 1 then for i := 2 to

n do a := Sum_sgr(a);

Succ := a

end;

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

begin

write(' '); readln(a);

i := 0;

repeat

i := i + 1

until (Succ(a, i) = 1) or (Succ(a, i) = 89);

write(' ', Succ(a, i));

writeln(' ', i);

writeln(' ');

for k := 1 to i do write(Succ(a, k), ' '); writeln

end.

2

{ }

Program min_gold;

uses WinCrt;

var

a, b, x1, y1, x2, y2, x, y, e : real;

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

Function fx(x : real) : real;

begin

fx := 4*x*x*x*x - 14*x*x*x + 60*x*x - 70*x

end;

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

Procedure gold1(a, b : real; var x1, y1 : real);

begin

x1 := 0.618*a + 0.382*b; y1 := fx(x1)

end;

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

Procedure gold2(a, b : real; var x2, y2 : real);

begin




- -  - -  - -