Created
November 2, 2018 10:26
-
-
Save jskeet/f386552fc3c9fa5c5cdfa27b90ed4677 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 Test { | |
public static void main(String[] args) { | |
int n = 1; // Less than 2 | |
int x = 1; | |
int y = 2; | |
while (y < n) { | |
// This is never reached | |
System.out.println("In while loop"); | |
if (n % y == 0) { | |
n = n / y; | |
x++; | |
} | |
else y++; | |
} | |
System.out.println(x + " " + n); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment