Guest User

Untitled

a guest
Dec 14th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class Ex4 {
  5.  
  6.     /**
  7.      * @param args
  8.      */
  9.     public static void main(String[] args) {
  10.         Scanner sc = new Scanner(System.in);
  11.         boolean a, b, c, d, expression;
  12.         a = false;
  13.         b = false;
  14.         c = false;
  15.         d = false;
  16.        
  17.         System.out.println("L'expression est vraie quand : ");
  18.        
  19.         do {
  20.             a = !a;
  21.             do {
  22.                 b = !b;
  23.                 do {
  24.                     c = !c;
  25.                     do {
  26.                         d = !d;
  27.                         expression = (a && b) ^ ! (c && !d);
  28.                         if(expression) {
  29.                             System.out.println("a = "+ (a ? "true" : "false") + ", b = " + (b ? "true" : "false") + ", c = " + (c ? "true" : "false") + ", d = "+(d?"true":"false"));
  30.                         }
  31.                     } while(d);
  32.                 } while(c);
  33.             } while(b);
  34.         } while(a);
  35.  
  36.     }
  37.  
  38. }
Add Comment
Please, Sign In to add comment