Advertisement
Maksud3

Lab5(VZ)

May 25th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.10 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <locale.h>
  4.  
  5. int main(void)
  6. {
  7.     setlocale(LC_ALL, "Ukr");
  8.  
  9.     const double K = 5.498, L = 0.995, M = 3.14;
  10.     double x, y, x_first, x_last, step, a, b;
  11.  
  12.     printf("Введiть першу границю -> ");
  13.     scanf("%lf", &x_first);
  14.     printf("Введiть другу границю -> ");
  15.     scanf("%lf", &x_last);
  16.     printf("Введiть крок табуляции -> ");
  17.     scanf("%lf", &step);
  18.  
  19.     printf("\t+------------------|------------------|------------------|------------------+\n");
  20.     printf("\t|\ta = \t\t    b = \t\tx = \t\t  y = \t    |\n");
  21.     printf("\t+------------------|------------------|------------------|------------------+\n");
  22.  
  23.     for (x_first; x_first <= x_last; x_first += step)
  24.     {
  25.         a = (K - (pow(x_first, 1. / 3) / 4.0));
  26.         b = b = L + tan(log(x_first)) + 2 * M;
  27.  
  28.         if (a >= b)
  29.         {
  30.             y = log(a - b);
  31.         }
  32.         else
  33.         {
  34.             y = log(b - a);
  35.         }
  36.  
  37.         printf("\t|    %8.2lf\t\t%8.2lf\t   %8.2lf\t     %8.2lf\t    |\n", a, b, x_first, y);
  38.     }
  39.     printf("\t+------------------|------------------|------------------|------------------+\n");
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement