Program zad_2;
Var x,y:real;
Begin
Writeln('BBOD x');
Read(x);
If x<-3 then
y:=x*x+sin(2*x+pi/6)
else
if x>=5 then
y:=ln(x*x+3*x)
else
y:=sqrt(sqr(sin(x))+abs(x));
writeln('x=',x:7:3,' y=',y:7:3);
end.
| #include <stdio.h>
#include <math.h>
int main(){
float x, y, a;
puts("BBOD x");
scanf("%f", &x);
if (x<-3) y=x*x+sin(2*x+M_PI/6);
else
if (x>=5) y=log(x*x+3*x);
else
y=sqrt(sin(x)*sin(x)+fabs(a));
printf("x=%7.3f\ny=%7.3f\n",x,y);
return 0;
}
|