begin
funk:=ln(x*a)+exp(2*ln(cos(a*x)))/sin(a*x)+SQRT((x+7)/a)+(x+7)+a;
end;
Begin
clrscr;
assign(f,'Otvet.txt');
rewrite(f);
a:=0;h:=0.001;h1:=0.001;
while a<4 do begin
writeln(f,'pri a=',a:8:4);
d:=0;
while x<=10 do begin
if (sin(a*x)<>0) and (x*a>0) and ((x+7)/a>=0) then begin funk (x,a);
if funk (x,a)=0 then begin
d:=d+1;
writeln(f,'x=',x:8:4);
end;
if funk (x,a)* funk (x+h1,a)<0 then
begin d:=d+1;
yn:=x;
yk:=x+h1;
e:=0.0001;
koren:=false;
while (abs(yk-yn)>e) and (not(koren)) do begin
y:=(yk+yn)/2;
if funk (y,a)=0 then koren:=true
else if funk (yn,a)* funk (y,a)<0 then
yk:=y
else yn:=y;
end;
if koren=true then writeln(f,'x=',y:8:4)
else writeln(f,'x=',yn:8:4);
end;
end;
x:=x+h1;
end;
writeln(f,'kopHey ',d);
a:=a+h;
end;
close(f);END.
Результаты счета:
pria= -1.1000
kopHey 1
x=-9.9990
pri a= -5.0000
kopHey 2
x= -7. 6670
x= -7.0740
pri a= -7.0100
kopHey 3
x= -9.8300
x= -11.6230
x= -18.9510
pri a= -11.2020
kopHey 4
x= -7.0010
x= -9.4230
x= -7.1030
x= -10.4930
pri a= -13.9320
kopHey 5
x= -7.1726
x= -9.2348
x= -9.3293
x= -10.7739
x= -11.3739