Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. public class DepuracionCajaBlanca {
  2.  
  3. /**
  4. * @param args
  5. */
  6. public static void main(String[] args) {
  7. // TODO Auto-generated method stub
  8.  
  9. int a, b;
  10. boolean a_p = false, b_p = false, t_a = false, t_b = false;
  11.  
  12. a = 25;
  13. b = 5;
  14.  
  15. if (a % 2 == 0)a_p = true; //A es par
  16. if (b % 2 == 0)b_p = true; //B es par
  17.  
  18. if (a_p == false && b_p == false ){
  19. System.out.println("a / b / a es par? / b es par? / a es divisible entre 3? / b es divisible entre 3?");
  20. if (a % 3 == 0 )t_a = true;
  21. if (b % 3 == 0 )t_b = true;
  22.  
  23.  
  24. }else{
  25.  
  26. System.out.println("a / b / a es par? / b es par? / a es divisible entre b? / b es divisible entre a ?");
  27. if (a % b == 0)t_a = true;
  28. if (b % a == 0)t_b = true;
  29.  
  30. }
  31.  
  32. System.out.println(a + "/" + b + "/" +a_p + "/" + b_p + "/" + t_a + "/" + t_b);
  33.  
  34. }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement