Advertisement
Korobka887

КР.Вариант7

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