Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class demo {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = Integer.parseInt(scanner.nextLine());
- int m = Integer.parseInt(scanner.nextLine());
- int l = Integer.parseInt(scanner.nextLine());
- for (int i = 1; i <= n; i++) {
- if (i % 2 == 0) {
- for (int j = 1; j <= m; j++) {
- int counter = 0;
- for (int p = 2; p <= j / 2; p++) {
- if (j % p == 0) {
- counter++;
- }
- }
- if (counter == 0&&j!=1) {
- for (int k = 1; k <= l; k++) {
- if (k % 2 == 0) {
- System.out.printf("%d %d %d%n", i, j, k);
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement