Advertisement
niromru

pr2

Nov 30th, 2021
990
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <locale.h>
  4. #include <math.h>
  5.  
  6. int main()
  7. {
  8.     setlocale(LC_ALL, "Rus");
  9.     double x, y, f;
  10.     printf("Введите x: ");
  11.     scanf("%lf", &x);
  12.     printf("Введите y: ");
  13.     scanf("%lf", &y);
  14.     ((x >= 0) && (x < 5))?printf("получилось %f\n", f=2*x-y):((x < 0) && (y < 0))?printf("получилось %f\n", f= pow(x,2)):printf("получилось %f\n", f = 5*y+1);
  15.     printf("Значение функции: %f", f);
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement