code: public static int gcd(int m, int n) {
      if (m == 0 && n == 0)
        return 0;
      if (m < n) {
        int t = m;
        m = n;
        n = t;
      }
      int r = m % n;
      if (r == 0) {
        return n;
      } else {
        return gcd(n, r);
      }
    }
docs: Determines the greatest common divisor (GCD) of two integers.
  
  @param m the first integer
  @param n the second integer
  
  @return the greatest common divisor of m and n