Created
April 14, 2017 02:22
-
-
Save LuxXx/f2680042285498b1094b8babf7baa9f8 to your computer and use it in GitHub Desktop.
Project Euler - Problem 5
This file contains 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
package euler; | |
public class Divisible { | |
public static void main(String[] args) { | |
for (long i = 0; i < Long.MAX_VALUE; i++) { | |
if (isDivisible(i)) System.out.println(i); | |
} | |
} | |
public static boolean isDivisible(long n) { | |
for (int i = 1; i <= 20; i++) { | |
if (n % i != 0) return false; | |
} | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment