velikova_olya

Special Combinations

Mar 12th, 2018
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. package my_Programming_Basics_Test;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Special_Combinations {
  6. public static void main(String[] args) {
  7. Scanner console = new Scanner(System.in);
  8.  
  9. int firstNumber = Integer.parseInt(console.nextLine());
  10. int secondNumber = Integer.parseInt(console.nextLine());
  11. int thirdNumber = Integer.parseInt(console.nextLine());
  12.  
  13. for (int i = 1; i <= firstNumber; i++) {
  14. for (int j = 1; j <= secondNumber; j++) {
  15. for (int k = 1; k <= thirdNumber; k++) {
  16. if(i % 2 == 0 && k % 2 == 0){
  17. if(j == 2 || j == 3 || j == 5 || j == 7){
  18. System.out.println(i + " " + j + " " + k);
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }
  25. }
Add Comment
Please, Sign In to add comment