Где здесь ошибка? program p12; uses crt; var a,b,c: real; i,n: integer; function f(x: real): real; begin f: =sqr(sqr(x))+(sqr(x))*x-8*x(sqr(x))+5*x-3-cos(2*x); end; begin clrscr; a: =0; b: =1; n: =20; for i: =1 to n do begin c: =(a+b)/2; writeln('i=',i: 3, x=',c: 8: 5, f(x)=,f(c): 10: 5); if f(c)=0 then break else if f(c)*f(a)> 0 then a: =c else b: =c; end; end.
program P12;
uses crt;
var a,b,c:real;
i,n:integer;
function F(x:real):real;
begin
f:=sqr(sqr(x))+(sqr(x))*x-8*x*(sqr(x))+5*x-3-cos(2*x);
end;
begin
clrscr;
a:=0; b:=1; n:=20;
for i:=1 to n do
begin
c:=(a+B)/2;
writeln('i=',i:3,' x=',c:8:5,' f(x)=',f(c):10:5);
if f(c)=0 then break
else if f(c)*f(a)>0 then a:=c else b:=c;
end;
end.