pascal
Разработать алгоритм и записать программу табулирования функции используя значение аргумента функции
Приложения:
![](https://st.uroker.com/files/ba2/ba2d02da7578bdb27bb802c97103f183.jpg)
Ответы
Ответ дал:
0
const x0=1; xk=4; dx=0.3; y0=0.5; yk=1.5; dy=0.2;
var x,y,z: real; i,j:integer;
begin
writeln(' x y z');
x:=x0-dx;
for i:=0 to round((xk-x0)/dx) do
begin
x:=x+dx;
y:=y0-dy;
for j:=0 to round((yk-y0)/dy) do
begin
y:=y+dy;
z:=cos(x*y-1)+2;
writeln(x:4:1,' ',y:4:1,' ',z:6:4);
end;
end;
end.
Результат:
x y z
1.0 0.5 2.8776
1.0 0.7 2.9553
1.0 0.9 2.9950
1.0 1.1 2.9950
1.0 1.3 2.9553
1.0 1.5 2.8776
1.3 0.5 2.9394
...
3.7 1.5 1.8383
4.0 0.5 2.5403
4.0 0.7 1.7728
4.0 0.9 1.1431
4.0 1.1 1.0332
4.0 1.3 1.5097
4.0 1.5 2.2837
var x,y,z: real; i,j:integer;
begin
writeln(' x y z');
x:=x0-dx;
for i:=0 to round((xk-x0)/dx) do
begin
x:=x+dx;
y:=y0-dy;
for j:=0 to round((yk-y0)/dy) do
begin
y:=y+dy;
z:=cos(x*y-1)+2;
writeln(x:4:1,' ',y:4:1,' ',z:6:4);
end;
end;
end.
Результат:
x y z
1.0 0.5 2.8776
1.0 0.7 2.9553
1.0 0.9 2.9950
1.0 1.1 2.9950
1.0 1.3 2.9553
1.0 1.5 2.8776
1.3 0.5 2.9394
...
3.7 1.5 1.8383
4.0 0.5 2.5403
4.0 0.7 1.7728
4.0 0.9 1.1431
4.0 1.1 1.0332
4.0 1.3 1.5097
4.0 1.5 2.2837
Ответ дал:
0
Пожалуйста.
Ответ дал:
0
// PascalABC.NET 3.3, сборка 1633 от 10.02.2018
// Внимание! Если программа не работает, обновите версию!
begin
foreach var x in SeqWhile(1.0,i->i+0.3,i->i<=4.0) do begin
foreach var y in SeqWhile(0.5,i->i+0.25,i->i<=1.5) do
Writeln('x=',x:3:1,', y=',y:4:2,', z=',Cos(x*y-1)+2:12:9)
end
end.
Результат
x=1.0, y=0.50, z= 2.877582562
x=1.0, y=0.75, z= 2.968912422
x=1.0, y=1.00, z= 3.000000000
x=1.0, y=1.25, z= 2.968912422
x=1.0, y=1.50, z= 2.877582562
x=1.3, y=0.50, z= 2.939372713
x=1.3, y=0.75, z= 2.999687516
x=1.3, y=1.00, z= 2.955336489
x=1.3, y=1.25, z= 2.810963120
x=1.3, y=1.50, z= 2.581683089
x=1.6, y=0.50, z= 2.980066578
x=1.6, y=0.75, z= 2.980066578
x=1.6, y=1.00, z= 2.825335615
x=1.6, y=1.25, z= 2.540302306
x=1.6, y=1.50, z= 2.169967143
x=1.9, y=0.50, z= 2.998750260
x=1.9, y=0.75, z= 2.911038733
x=1.9, y=1.00, z= 2.621609968
x=1.9, y=1.25, z= 2.194547708
x=1.9, y=1.50, z= 1.724409753
x=2.2, y=0.50, z= 2.995004165
x=2.2, y=0.75, z= 2.796083799
x=2.2, y=1.00, z= 2.362357754
x=2.2, y=1.25, z= 1.821753944
x=2.2, y=1.50, z= 1.333723979
x=2.5, y=0.50, z= 2.968912422
x=2.5, y=0.75, z= 2.640996858
x=2.5, y=1.00, z= 2.070737202
x=2.5, y=1.25, z= 1.473733665
x=2.5, y=1.50, z= 1.075697621
x=2.8, y=0.50, z= 2.921060994
x=2.8, y=0.75, z= 2.453596121
x=2.8, y=1.00, z= 1.772797905
x=2.8, y=1.25, z= 1.198856384
x=2.8, y=1.50, z= 1.001705224
x=3.1, y=0.50, z= 2.852524522
x=3.1, y=0.75, z= 2.243328794
x=3.1, y=1.00, z= 1.495153895
x=3.1, y=1.25, z= 1.035325854
x=3.1, y=1.50, z= 1.126479102
x=3.4, y=0.50, z= 2.764842187
x=3.4, y=0.75, z= 2.020794828
x=3.4, y=1.00, z= 1.262606284
x=3.4, y=1.25, z= 1.005870324
x=3.4, y=1.50, z= 1.425176053
x=3.7, y=0.50, z= 2.659983146
x=3.7, y=0.75, z= 1.797212557
x=3.7, y=1.00, z= 1.095927858
x=3.7, y=1.25, z= 1.114583665
x=3.7, y=1.50, z= 1.838323784
x=4.0, y=0.50, z= 2.540302306
x=4.0, y=0.75, z= 1.583853163
x=4.0, y=1.00, z= 1.010007503
x=4.0, y=1.25, z= 1.346356379
x=4.0, y=1.50, z= 2.283662185
// Внимание! Если программа не работает, обновите версию!
begin
foreach var x in SeqWhile(1.0,i->i+0.3,i->i<=4.0) do begin
foreach var y in SeqWhile(0.5,i->i+0.25,i->i<=1.5) do
Writeln('x=',x:3:1,', y=',y:4:2,', z=',Cos(x*y-1)+2:12:9)
end
end.
Результат
x=1.0, y=0.50, z= 2.877582562
x=1.0, y=0.75, z= 2.968912422
x=1.0, y=1.00, z= 3.000000000
x=1.0, y=1.25, z= 2.968912422
x=1.0, y=1.50, z= 2.877582562
x=1.3, y=0.50, z= 2.939372713
x=1.3, y=0.75, z= 2.999687516
x=1.3, y=1.00, z= 2.955336489
x=1.3, y=1.25, z= 2.810963120
x=1.3, y=1.50, z= 2.581683089
x=1.6, y=0.50, z= 2.980066578
x=1.6, y=0.75, z= 2.980066578
x=1.6, y=1.00, z= 2.825335615
x=1.6, y=1.25, z= 2.540302306
x=1.6, y=1.50, z= 2.169967143
x=1.9, y=0.50, z= 2.998750260
x=1.9, y=0.75, z= 2.911038733
x=1.9, y=1.00, z= 2.621609968
x=1.9, y=1.25, z= 2.194547708
x=1.9, y=1.50, z= 1.724409753
x=2.2, y=0.50, z= 2.995004165
x=2.2, y=0.75, z= 2.796083799
x=2.2, y=1.00, z= 2.362357754
x=2.2, y=1.25, z= 1.821753944
x=2.2, y=1.50, z= 1.333723979
x=2.5, y=0.50, z= 2.968912422
x=2.5, y=0.75, z= 2.640996858
x=2.5, y=1.00, z= 2.070737202
x=2.5, y=1.25, z= 1.473733665
x=2.5, y=1.50, z= 1.075697621
x=2.8, y=0.50, z= 2.921060994
x=2.8, y=0.75, z= 2.453596121
x=2.8, y=1.00, z= 1.772797905
x=2.8, y=1.25, z= 1.198856384
x=2.8, y=1.50, z= 1.001705224
x=3.1, y=0.50, z= 2.852524522
x=3.1, y=0.75, z= 2.243328794
x=3.1, y=1.00, z= 1.495153895
x=3.1, y=1.25, z= 1.035325854
x=3.1, y=1.50, z= 1.126479102
x=3.4, y=0.50, z= 2.764842187
x=3.4, y=0.75, z= 2.020794828
x=3.4, y=1.00, z= 1.262606284
x=3.4, y=1.25, z= 1.005870324
x=3.4, y=1.50, z= 1.425176053
x=3.7, y=0.50, z= 2.659983146
x=3.7, y=0.75, z= 1.797212557
x=3.7, y=1.00, z= 1.095927858
x=3.7, y=1.25, z= 1.114583665
x=3.7, y=1.50, z= 1.838323784
x=4.0, y=0.50, z= 2.540302306
x=4.0, y=0.75, z= 1.583853163
x=4.0, y=1.00, z= 1.010007503
x=4.0, y=1.25, z= 1.346356379
x=4.0, y=1.50, z= 2.283662185
Вас заинтересует
2 года назад
2 года назад
8 лет назад
8 лет назад