Skip to content

Instantly share code, notes, and snippets.

@tolpp
Last active December 23, 2017 12:37
Show Gist options
  • Select an option

  • Save tolpp/a55487fcc7aaa3ae44b6 to your computer and use it in GitHub Desktop.

Select an option

Save tolpp/a55487fcc7aaa3ae44b6 to your computer and use it in GitHub Desktop.
public class ConsecutiveIntegerChecking {
static int GCD(int m, int n) {
int t = n;
if (m < n)
t = m;
while (t > 1) {
if (m % t == 0 && n % t == 0)
return t;
t--;
}
return 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment