Quine Mc Cluskey and Automat

Benutzeravatar
davidvajda.de
Site Admin
Beiträge: 1540
Registriert: Di Jul 18, 2023 8:36 pm
Wohnort: D-72072, Tübingen
Kontaktdaten:

Re: Quine Mc Cluskey and Automat

Beitrag von davidvajda.de »

Code: Alles auswählen

#include <stdio.h>
#include <time.h>
#include <stdlib.h>

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

int main (void) {
        int x, z2, z1, z0;
        time_t t;
        int i;
        
        srand((unsigned) time(&t));
        
        printf ("\tb a x\tb a y\n");
            for (i = 0, z1 = 0;  z1 <= 1;  z1++) {
                for (z0 = 0;  z0 <= 1;  z0++) {
                    for (x = 0;  x <= 1;  x++, i++) {
                        printf ("%i\t%i %i %i\t%i %i %i\n", i, z1, z0, x, rand () % 2, rand () % 2, rand () % 2);
                    }
                }
            }
    
return 0;
}
Antworten