Advertisement
elena_tasheva

Untitled

Oct 31st, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class UniquePIN {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. int n1 = Integer.parseInt(scanner.nextLine());
  7. int n2 = Integer.parseInt(scanner.nextLine());
  8. int n3 = Integer.parseInt(scanner.nextLine());
  9. boolean flag = false;
  10. for (int i = 2; i <= n1 ; i++) {
  11. for (int j = 2; j <= n2; j++) {
  12. flag= false;
  13. for (int m = 2; m <= j/2 ; m++) {
  14. if(j%m==0){
  15. flag=true;
  16. } }
  17. for (int k = 2; k <= n3; k++) {
  18. if ((i%2==0) && (!flag) && (k%2==0)){
  19. System.out.print("" + i + " " + j + " " + k);
  20. System.out.println();
  21.  
  22.  
  23. }
  24. }
  25.  
  26. }
  27.  
  28. }
  29.  
  30. }
  31.  
  32.  
  33.  
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement