-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEx6.java
27 lines (21 loc) · 1.03 KB
/
Ex6.java
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
package Original_Exam_1;
import java.util.Scanner;
public class Ex6 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int maxFirst = Integer.parseInt(scanner.nextLine());
int maxSecond = Integer.parseInt(scanner.nextLine());
int maxThird = Integer.parseInt(scanner.nextLine());
for (int firstDigit = 1; firstDigit <= maxFirst; firstDigit++) {
for (int secondDigit = 1; secondDigit <= maxSecond; secondDigit++) {
for (int thirdDigit = 1; thirdDigit <= maxThird; thirdDigit++) {
if (firstDigit % 2 == 0 && thirdDigit % 2 == 0) {
if (secondDigit == 2 || secondDigit == 3 || secondDigit == 5 || secondDigit == 7) {
System.out.printf("%d %d %d%n", firstDigit, secondDigit, thirdDigit);
}
}
}
}
}
}
}