-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproblemFive.java
More file actions
39 lines (36 loc) · 845 Bytes
/
problemFive.java
File metadata and controls
39 lines (36 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication47;
/**
*
* @author Mike
*/
public class problemFive {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
System.out.println(problem5());
}
public static int problem5() {
int i = 2520;
boolean found = false;
while (!found) {
i += 2520;
boolean isDividable = true;
for (int j = 11; j <= 20; j++) {
if (i % j != 0) {
isDividable = false;
break;
}
}
if (isDividable) {
found = true;
}
}
return i;
}
}