Advertisement
Korobka887

Вариант 5. Таск 2

Mar 31st, 2023 (edited)
813
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main() {
  5.     double a, b, c;
  6.     int n;
  7.     scanf("%lf%lf%d", &a, &b, &n);
  8.     c = (b - a) / n;
  9.    
  10.     for (double x = a; x <= b; x += c) {
  11.         printf("%lf | ", x);
  12.         if (x <= -10)
  13.             printf("%lf", 1 / (2 + sin(2  * x)));
  14.         else if (x <= -2)
  15.             printf("%lf", exp(-2 * x) * pow(cos(pow(x, 2) / 5), 2));
  16.         else
  17.             printf("%lf", (0.3 * x + 2) * sin(x / (pow(x, 2) + 5)));
  18.        
  19.         printf("\n");
  20.     }
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement