Var
x0, xk, dx, e, x, a, s: real;
i: integer;
begin
write('Введите промежуток и шаг ([a,b] h) и точность Е ');
readln(x0, xk, dx, e);
x := x0;
writeln(' i ':3, ' | ', ' x ':10, ' | ', ' s ':10, ' | ', ' y(x) ':10);
repeat
a := 1;
s := a;
i := 0;
repeat
i := i + 1;
a := a * (-1) * 2 * x / (2 * i) / (2 * i - 1);
s := s + a;
until abs(a) < e;
writeln(i:3, ' | ', x:10:3, ' | ', s:10:3, ' | ', (cos(sqrt(2 * x))):10:3);
x := x + dx;
until x >= xk;
end.
На паскале
---
uses crt;
const n=3;
m=3;
var a: array [1..n,1..m] of integer;
x,y,k: integer;
begin
k:=0;
for x:=1 to n do begin
for y:=1 to m do begin
a[x,y]:=random(21)-10;
if a[x,y] mod 2=1 then inc(k);
write(a[x,y]:4);
end;
writeln;
end;
writeln('Количество неотрицательных нечетных элементов: ',k);
<span>end.</span>
M=6/////////////////////////////////////
Program s;
var
a,b:integer;
begin
readln(b);
for a:=1 to b do
if a mod 2 = 0 then writeln(a*a) else writeln('-1');
end.