Advertisement
Korobka887

20-3

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