Advertisement
Fargoth_Cor

Untitled

Oct 12th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int gcd(int a, int b)
  4.     {
  5.         if (b == 0) return a;
  6.             return gcd(b, a % b);
  7.        
  8.     }
  9.    
  10. int main() {
  11.     int a, b;
  12.     cin >> a >> b;
  13.     cout <<gcd(a, b) << endl;
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement