SHARE
TWEET

Untitled

Bisus Oct 12th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int scanf(const char *,...);
  2. int printf(const char *,...);
  3. void f(double x, double y, double z, double *a, double *b);
  4.  
  5. void f(double x, double y, double z, double *a/* Здесь будет максимум */, double *b/* Здесь будет минимум */)
  6. {
  7.     *a = x;
  8.     if(y>*a) *a = y;
  9.     if(z>*a) *a = z;
  10.  
  11.     *b = x;
  12.     if(y<*b) *b = y;
  13.     if(z<*b) *b = z;
  14. }
  15.  
  16. int main(void)
  17. {
  18.     double x, y, z, a, b;
  19.  
  20.     printf("Input: (x,y,z)\n");
  21.     scanf("%lf%lf%lf", &x, &y, &z);
  22.  
  23.     f(x, y, z, &a, &b);
  24.     printf("a=%lf\tb=%lf\n", a, b);
  25.  
  26.     return 0;
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top