Wednesday, June 13, 2012

Greatest Common Divisor

template <class T>
T gcd (T a, T b){
   return b != 0 ? gcd(b, a%b) : a;
}

No comments:

Post a Comment