// Geoff Hagopian -- gcd algo

#include <iostream>
using namespace std;

int gcd(int, int);

int main() {
	int a{ 0 }, b{ 0 };
	cout << "Enter two ints to compute their greatest common divisor: ";
	while (cin >> a >> b) {
		cout << "The gcd(" << a << ", " << b << ") is " << gcd(a, b);
		cout << "\nEnter two ints to compute their greatest common divisor: ";
	}
}

int gcd(int a, int b) {
	if (b == 0) return a;
	else return gcd(b, a % b);
}