Advertisement
Savelyev_Vyacheslav

laba_1.c

May 29th, 2020 (edited)
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.10 KB | None | 0 0
  1. #include <conio.h>
  2. #include <math.h>
  3. #include <stdio.h>
  4. #include <windows.h>
  5. main() {
  6.     SetConsoleCP(1251);
  7.     SetConsoleOutputCP(1251);
  8.     float a, b, x, z, stepen_e, stepen_x_2;
  9.     char Error_text[] = "NET resheniay";
  10.     printf("Vvedite a: ");
  11.     scanf("%f",&a);
  12.     printf("Vvedite b: ");
  13.     scanf("%f",&b);
  14.     printf("Vvedite x: ");
  15.     scanf("%f",&x);
  16.     if (x<=a) {
  17.         printf("esly x<=a ");
  18.         ///////////////<vihod>
  19.         if  ((x<=a)&&(x<0)) {
  20.             printf("%s. 1",Error_text);
  21.             exit(0);
  22.         }
  23.         ///////////////</vihod>
  24.         z= log(pow(27,((float)1/3))+sqrt(x)+sin(x)+cos(x));    //pow(x,y) — x^y
  25.     }
  26.  
  27.     else if ((a<x)&&(x<b)) {
  28.         printf("esly a<x<b ");
  29.         stepen_e=cosh(x)+tanh(x);
  30.         stepen_x_2=pow(x,2);
  31.         z=  pow( (pow(tan(x),2)+1.3*exp(stepen_e)) ,  stepen_x_2);
  32.     } else if (x >= b) {
  33.         printf("esly x >= b ");
  34.         ///////////////<vihod>
  35.         if  ((x>=b)&&(x>=1))  {
  36.             printf("%s. 2",Error_text);
  37.             exit(0);
  38.         } else if  ((x>=b)&&(x<0)) {
  39.             printf("%s. 3",Error_text);
  40.             exit(0);
  41.         }
  42.         ///////////////</vihod>
  43.         z=fabs(sin(x)-0.11)*acos(x) +  pow(x, asin(x));
  44.     }
  45.     printf("REZULTAT z = %f\n",z);
  46.     return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement