Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int cmmdc(int a,int b)
  4. {if(a>b) return a=cmmdc(a-b,b);
  5. else if(a<b) return a=cmmdc(a,b-a);
  6. else return a;
  7.  
  8. }
  9. int main()
  10. {int x,y;
  11. cin>>x>>y;
  12. cout<<"cmmdc este "<<cmmdc(x,y);
  13.  
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement