Консольное приложение: program P; {$APPTYPE CONSOLE} uses Windows, SysUtils;
var xn,xk,dx,x,z,s,p:real; i:integer; begin readln(xn,xk,dx); x:=xn-dx; s:=0; p:=1; for i:=1 to round((xk-xn)/dx)+1 do begin x:=x+dx; z:=sin(cos(x)); if z>x then s:=s+z else p:=p*z; if i mod 3=1 then writeln(i,' ',x:5:3,' ',z:7:5); end; writeln('s = ',s,' p = ',p); end.
program P;
{$APPTYPE CONSOLE}
uses Windows, SysUtils;
var xn,xk,dx,x,z,s,p:real; i:integer;
begin
readln(xn,xk,dx);
x:=xn-dx;
s:=0; p:=1;
for i:=1 to round((xk-xn)/dx)+1 do
begin
x:=x+dx;
z:=sin(cos(x));
if z>x then s:=s+z else p:=p*z;
if i mod 3=1 then writeln(i,' ',x:5:3,' ',z:7:5);
end;
writeln('s = ',s,' p = ',p);
end.
Пример:
-3.14 3.14 0.314
1 -3.140 -0.84147
4 -2.198 -0.55377
7 -1.256 0.30470
10 -0.314 0.81406
13 0.628 0.72374
16 1.570 0.00080
19 2.512 -0.72309
s = 1.542042441906335e+00 p = -1.119447732428404e-05