Условие задачи
Построить график функции
на отрезке [-10, 10],
и вывести корни .
Ответ
Program graphic;
uses crt, graph;
const n = 10000;
var x, y:real;
driver, mode : integer;
cx, cy, mx, my, ex, ey : integer;
a, b, s : real;
strx, stry : string;
function f ( x : real) : real;
begin
f:=cos(x)-0.2*x;
end;
function root ( a, b, e : real ) : real;
var c : real;
begin
repeat
c : = (a + b) / 2;
if f ( a ) * f ( c ) = 0 then b : = c else a : = c
until abs ( f ( c ) ) e;
root : = c
end;
function maxabsy ( a , b : real ) : real;
var m,x:real;
begin
m : = abs ( f ( a ) ); x : = a + ( b a ) / n;
repeat
if abs ( f ( x ) ) m then m : = abs ( f ( x ) );
x : = x + ( b a ) / n;
until x b;
maxabsy : = m;
end;
procedur...