Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main()
  4. {
  5.     double x,t,y;
  6.     scanf("%lf", &x);
  7.     if(x>1)
  8.     {
  9.         t = tan(x*x-1);
  10.         if (t<0)
  11.         {
  12.             printf("ERROR\n");
  13.             return 0;
  14.         }
  15.         else y = sqrt(t);
  16.     }
  17.     else if (x<0) y=exp(cos(x));
  18.     else y = -2*x;
  19.     printf("%.6lf",y);
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement