Advertisement
Spocoman

08. Secret Door's Lock

Aug 30th, 2024
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SecretDoorsLock {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int a = Integer.parseInt(scanner.nextLine()),
  7.                 b = Integer.parseInt(scanner.nextLine()),
  8.                 c = Integer.parseInt(scanner.nextLine());
  9.  
  10.         for (int i = 2; i <= a; i++) {
  11.             for (int j = 2; j <= b; j++) {
  12.                 for (int x = 2; x <= c; x++) {
  13.                     if (i % 2 == 0 && x % 2 == 0 && (j == 2 || j == 3 || j == 5 || j == 7)) {
  14.                         System.out.println(i + " " + j + " " + x);
  15.                     }
  16.                 }
  17.             }
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement