Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int a,b,num,cif1,cif2,med, z=1;
  6.  
  7. int main()
  8.  
  9. {
  10.  
  11.    cin >> a >> b;
  12.  
  13.    while (a!=0)
  14.  
  15.    {
  16.  
  17.        cif1=a%10; cif2=b%10;
  18.  
  19.        med=(cif1+cif2)/2;
  20.  
  21.        a=a/10; b=b/10;
  22.  
  23.        num=med*z+num;
  24.  
  25.        z=z*10;
  26.  
  27.    }
  28.  
  29.    cout << num;
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement