S001-AC.cc
303 Bytes
#include <iostream>
using namespace std;
int main()
{
int a,b,x,y;
cin >> a;
cin >> b;
x=a;
y=b;
do
{
if(x > y)
{
x -= y;
}
else
{
y -= x;
}
}while(y);
cout << "The gcd of " << a << " and " << b << " is " << x << "." << endl;
return 0;
}