program Eiler; uses crt; const n = 5; {kol-vo iteracii} h = 0.1; {shag} var k: word; xk, yk, dy: real;
function FotXY(x, y: real): real; begin FotXY := y - 2 * x / y; end;
begin clrscr; xk := 0; {nachal'nie usloviya} yk := 1; {nachal'nie usloviya} writeln(' k | xk | yk |'); for k := 0 to n do begin dy := h * FotXY(xk, yk); yk := yk + dy; xk := xk + h; writeln(k:3, ' ', xk:2:4, ' ', yk:2:4); end; readkey; end.
Источник: |