{smotri Eilera!} program Runge_Kutt; uses crt; const h = 0.2; n = 5; var i: word; xi, yi, dy: real; k1, k2, k3, k4: real;
function FotXY(x, y: real): real; begin FotXY := y - 2 * x / y; end;
begin clrscr; xi := 0; yi := 1; writeln(' k | xk | yk |'); for i := 0 to n do begin k1 := h * fotxy(xi, yi); k2 := h * fotxy(xi + h/2, yi + k1/2); k3 := h * fotxy(xi + h/2, yi + k2/2); k4 := h * fotxy(xi + h, yi + k3); dy := (k1 + 2*k2 + 2*k3 + k4) / 6; yi := yi + dy; xi := xi + h; writeln(i:3, ' ', xi:2:4, ' ', yi:2:4); end; readkey; end.