Advertisement
Guest User

Untitled

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