Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Y(x:integer;var err:boolean):real;
- begin
- err:=false;
- if x in [1,3,5,7] then Y := sqr(x+cos(x))
- else if x in [2,4,6,8] then
- begin
- if (sin(x)/5>=0) then Y := sqrt(sin(x)/5)
- else err:=true
- end
- else
- begin
- if ((x+2)>0) then Y := x+ln(x+2)
- else err:=true;
- end;
- end;
- var x,a,b:integer; rr:boolean; Yx:real;
- BEGIN
- write('a=');readln(a);
- write('b=');readln(b);
- for x := a to b do
- begin
- Yx:=Y(x,rr);
- write('Y(',x,')=');
- if not(rr) then writeln(Yx:0:3)
- else writeln('Невозможно вычислить!');
- end;
- END.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement