// PascalABC.NET 3.3
begin
var (x0,xk,h):=ReadlnReal3('x0, xk, h: ');
var b:=1.5;
var n:=round((xk-x0)/h);
var x:=Range(0,n).Select((x,i)->x0+i*h);
x.Foreach(x->Writeln(x:4:1,' ',
x<2?arctan(x)+sqrt(abs(x-2)):x=2?(5-b*b)+cos(pi*x):ln(x-2)*sin(x/2)));
end.
Пример:
x0, xk, h: 0 4 0.5
0.0 1.4142135623731
0.5 1.6883924803924
1.0 1.78539816339745
1.5 1.68990050443388
2.0 3.75
2.5 -0.657786013301077
3.0 0
3.5 0.398971968326155
4.0 0.630276947694634
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
// PascalABC.NET 3.3
begin
var (x0,xk,h):=ReadlnReal3('x0, xk, h: ');
var b:=1.5;
var n:=round((xk-x0)/h);
var x:=Range(0,n).Select((x,i)->x0+i*h);
x.Foreach(x->Writeln(x:4:1,' ',
x<2?arctan(x)+sqrt(abs(x-2)):x=2?(5-b*b)+cos(pi*x):ln(x-2)*sin(x/2)));
end.
Пример:
x0, xk, h: 0 4 0.5
0.0 1.4142135623731
0.5 1.6883924803924
1.0 1.78539816339745
1.5 1.68990050443388
2.0 3.75
2.5 -0.657786013301077
3.0 0
3.5 0.398971968326155
4.0 0.630276947694634