Segrif
Как-то так const a=5.8; x1=-3; x2=3; dx=0.5; var x,k,p,s:real; function t(i:real):real; begin result:=sqr(sin(i-4)) end; function y(i:real):real; beginif t(i)>=5 then result:=sin(pi/2+i)/cos(pi/2-i) else result:=ln(a+i)/sqr(a) end; begin x:=x1; k:=0; s:=0; p:=1; while x<=x2 do begin writeln('x = ',x,' y = ',y(x),' t = ',t(x)); if y(x)<0 then k:=k+1; if t(x)>=0 then begin s:=s+t(x); p:=p*t(x) end; x:=x+dx; end; writeln('k = ',k,' P = ',p,' S = ',s) end.
Answers & Comments
const a=5.8; x1=-3; x2=3; dx=0.5;
var x,k,p,s:real;
function t(i:real):real;
begin
result:=sqr(sin(i-4))
end;
function y(i:real):real;
beginif t(i)>=5 then result:=sin(pi/2+i)/cos(pi/2-i) else result:=ln(a+i)/sqr(a)
end;
begin
x:=x1; k:=0; s:=0; p:=1;
while x<=x2 do
begin
writeln('x = ',x,' y = ',y(x),' t = ',t(x));
if y(x)<0 then k:=k+1;
if t(x)>=0 then begin s:=s+t(x); p:=p*t(x) end;
x:=x+dx;
end;
writeln('k = ',k,' P = ',p,' S = ',s)
end.