/media/sda-magnetic/david/Dokumente-15/fernuni-hagen/cs-i-ii/old-cs-2-01/cs-aufgaben-ws-2021/aufg003.c


#include <stdio.h>

/*
a = (x and b)
b = (a and not x) or (b and x)
c = (b and not x) or (a and x) or (c and not x)
y = a or c or (b and not x)
*/

#define and &&
#define or ||
#define not !


int main (void) {
    int c, b, a, x;
    
    printf ("c\tb\ta\tx\t\tc\tb\ta\tx\n");
    for (c = 0;  c <= 1;  c++) {
        for (b = 0;  b <= 1;  b++) {
            for (a = 0;  a <= 1;  a++) {
                for (x = 0;  x <= 1;  x++) {
                    printf ("%i\t%i\t%i\t%i\t\t%i\t%i\t%i\t%i\n", c, b, a, x, x and b, (a and not x) or (b and x), (b and not x) or (a and x) or (c and not x), a or c or (b and not x));
                }
            }
        }
    }
    
return 0;
}