Last active
December 23, 2017 12:37
-
-
Save tolpp/a55487fcc7aaa3ae44b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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