daily pastebin goal
47%
SHARE
TWEET

Untitled

a guest Oct 12th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. void fun(double *a, double *b)
  4. {
  5.     double z,k;
  6.     if (*a<*b)
  7.     {
  8.         z=*a**b*2;
  9.         k=(*a+*b)/2;
  10.     }
  11.     else
  12.     {
  13.         k=*b**a*2;
  14.         z=(*a+*b)/2;   
  15.     }
  16.     *a=z;
  17.     *b=k;
  18.     return;
  19. }
  20. int main()
  21. {
  22.     double x,y,*x1,*y1;
  23.     cin>>x>>y;
  24.     x1=&x;
  25.     y1=&y;
  26.     fun(x1,y1);
  27.     cout<<x<<endl<<y;
  28.     return 0;
  29. }
RAW Paste Data
Top