Advertisement
Korobka887

14-3

Jun 19th, 2023
943
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 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 <= 5) {
  15.             printf("%lf\n", 4 * fabs(sin(4 * x + 1) + 0.5));
  16.         } else if (x <= 11) {
  17.            printf("%lf\n", pow(x, 2) / 11 + 0.5 * sin(3 * x));
  18.         } else {
  19.             printf("%lf\n", pow(x, 2) / (pow(x + 11, 2) + 2 * x + 1));
  20.         }
  21.        
  22.     }
  23.  
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement