{usovershenstvovanii metod Eilera ili metod srednih} program Putched_Eiler; uses crt; const h = 0.2; {shag} n = 4; {kol-vo iteracii} var k: word; xk, yk, dy, xk2, yk2: real;
function FotXY(x, y: real): real; begin FotXY := y - 2 * x / y; end; {FotXY - eto vse chto sprava ot Y` (uravnenie: Y` = Y - 2*x/Y)}
begin clrscr; xk := 0; {nachal'nie usloviya} yk := 1; {nachal'nie usloviya} writeln(' k | xk | yk |'); for k := 0 to n do begin xk2 := xk + h / 2; yk2 := yk + FotXY(xk, yk) * h / 2; dy := h * FotXY(xk2, yk2); yk := yk + dy; xk := xk + h; writeln(k:3, ' ', xk:2:4, ' ', yk:2:4); end; {resul'tat v vide tablici} readkey; end.