Advertisement
valiamaximova1

Numbers exam basic java

Feb 28th, 2021 (edited)
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.01 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class new11 {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.         int firstNum = Integer.parseInt(scan.nextLine());
  7.         int secondNum = Integer.parseInt(scan.nextLine());
  8.         int thirdNum = Integer.parseInt(scan.nextLine());
  9.  
  10.         for (int i = 1; i <= firstNum; i++) {
  11.             if (i % 2 == 0) {
  12.                 if (secondNum > 7 || secondNum < 2) {
  13.                     continue;
  14.                 }
  15.                 for (int j = 2; j <= secondNum; j++) {
  16.                     if (j == 4) {
  17.                         continue;
  18.                     }
  19.                     if (j == 6) {
  20.                         continue;
  21.                     }
  22.                     for (int k = 1; k <= thirdNum; k++) {
  23.                         if (k % 2 == 0) {
  24.                             System.out.printf("%d %d %d\n", i, j, k);
  25.                         }
  26.                     }
  27.                 }
  28.             }
  29.  
  30.  
  31.         }
  32.     }
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement