10
[1] N=10
[2] S=3, x1=2, x2=1
[7] Цикл
[7] i=3
[8] x=1.1, S=4.1, x1=1, x2=1.1
[7] i=4
[8] x=1.03, S=5.13, x1=1.1, x2=1.03
[7] i=5
[8] x=0.989, S=6.119, x1=1.03, x2=0.989
[7] i=6
[8] x=0.9457, S=7.0647, x1=0.989, x2=0.9457
[7] i=7
[8] x=0.90491, S=7.96961, x1=0.9457, x2=0.90491
[7] i=8
[8] x=0.865783, S=8.835393, x1=0.90491, x2=0.865783
[7] i=9
[8] x=0.8283629, S=9.6637559, x1=0.865783, x2=0.8283629
[7] i=10
[8] x=0.79255777, S=10.45631367, x1=0.8283629, x2=0.79255777
[9] S=10.45631367
10.45631367
А это текст программы в PascalABC.NET 3.4, которая расписала вывод. Не вручную же, на самом деле, его писать !!!
begin
var n := ReadInteger;
$'[1] N={n}'.Println;
var (s, x1, x2) := (3.0, 2.0, 1.0);
$'[2] S={s}, x1={x1}, x2={x2}'.Println;
if n = 1 then
begin
s := x2;
$'[3] N=1 -> [4] S={s}'.Println
end
else
if n = 2 then
begin
s := x1 + x2;
$'[5] N=2 -> [6] S={s}'.Println
end
else
begin
$'[7] Цикл'.Println;
for var i := 3 to n do
begin
$'[7] i={i}'.Println;
var x := 0.8 * x2 + 0.15 * x1;
s += x;
x1 := x2;
x2 := x;
$'[8] x={x}, S={s}, x1={x1}, x2={x2}'.Println
end;
end;
$'[9] S={s}'.Println;
s.Println
end.