title: Get the gcd of n numbers
body: <p>This could seem an easy question but I cannot find a solution. I must find the gcd of n numbers.</p>
  
  <pre><code>public int getGCD(int a, int b) {
   if (b == 0) { return a; }
   else { return getGCD(b, a%b); }
  }
  </code></pre>
  
  <p>This is the popular recursive way that calculates the gcd of <strong>two</strong> numbers. But if I need to get the gcd of 3, 4, 5... n numbers? I was thinking to do something like this:</p>
  
  <pre><code>public int getGCD(int[] a) {
   //the code  
  }
  </code></pre>
  
  <p>There is an array of integer as parameter, but I have no idea about the code. Do you have any suggestion?</p>