Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 24, 2020 16:56
Show Gist options
  • Save parzibyte/40563edc7213e1618cd8111852f9519c to your computer and use it in GitHub Desktop.
Save parzibyte/40563edc7213e1618cd8111852f9519c to your computer and use it in GitHub Desktop.
public static int maximoComunDivisor(int a, int b) {
int temporal;//Para no perder b
while (b != 0) {
temporal = b;
b = a % b;
a = temporal;
}
return a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment