Program r_k;
const n=3;h=0.01;a=0;b=1;
type vector=array[1..n] of real;
var i:integer;
x:real;
y,f:vector;
procedure dy; {pravi chast. rivn}
begin
f[1]:=y[2];
f[2]:=y[3];
f[3]:=-2*y[3]-y[2]+x;
end;
procedure rk;
var k1,k2,k3,k4,z:vector;
begin
dy;
for i:=1 to n do
begin
k1[i]:=f[i];
z[i]:=y[i];
y[i]:=z[i]+0.5*h*k1[i];
end;
x:=x+0.5*h;
dy;
for i:=1 to n do
begin
k2[i]:=f[i];
y[i]:=z[i]+0.5*h*k2[i];
end;
dy;
for i:=1 to n do
begin
k3[i]:=f[i];
y[i]:=z[i]+h*k2[i];
end;
x:=x+0.5*h;
dy;
for i:=1 to n do
begin
begin
k4[i]:=f[i];
y[i]:=z[i]+h*(k1[i]+k4[i]+2*(k2[i]+k3[i]))/6;
end;
end;
end;
BEGIN
for i:=1 to n do
begin
writeln('Pochatkove znachennia(',i,')=');
read(y[i]);
end;
x:=a;
repeat
rk;
writeln('x=',x:4:4,'y1=',y[1]:4:4,'y2=',y[2]:4:4,'y3=',y[3]:4:4);
until x>b;
readln;
readln;
END.