Euclids algorithm in C++