Const x0=0; xn=6; h=0.2;
var x,y:real; i,n:integer;
begin
n:=round((xn-x0)/h)+1;
x:=x0-h;
for i:=1 to n do
begin
x:=x+h;
y:=cos(x/3+0.3);
writeln(x:4:1,y:8:3);
end;
end.
Результат:
0.0 0.955
0.2 0.934
0.4 0.908
0.6 0.878
0.8 0.844
1.0 0.806
1.2 0.765
1.4 0.720
1.6 0.672
1.8 0.622
2.0 0.568
2.2 0.512
2.4 0.454
2.6 0.393
2.8 0.331
3.0 0.267
3.2 0.203
3.4 0.137
3.6 0.071
3.8 0.004
4.0 -0.062
4.2 -0.129
4.4 -0.195
4.6 -0.260
4.8 -0.323
5.0 -0.386
5.2 -0.446
5.4 -0.505
5.6 -0.561
5.8 -0.615
6.0 -0.666