#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
char bstr [9];
char *itob (int x) {
int i;
for (i = 0; i < 8; i++)
bstr [i] = ' ';
for (i = 7; i >= 0; i-=2) {
bstr [i] = (x % 2) + '0';
x = x/2;
}
bstr [8] = 0;
return bstr;
}
int main (void) {
int x0, x1, x2, x3;
time_t t;
int i, j;
int x;
int y;
int a [16];
int b [16];
char str1 [16];
char str2 [16];
char str3 [16];
char str4 [16];
srand((unsigned) time(&t));
a [0] = rand () % 16;
for (i = 1; i < 16; i++) {
x = rand () % 16;
a [i] = x & 3;
b [i] = rand () % 16;
}
for (i = 0; i < 16; i++) {
strcpy (str1, itob (i));
strcpy (str2, itob (a[i]));
strcpy (str4, str2+4);
strcpy (str2, str4);
strcpy (str3, itob (b[i]));
printf( "%s %s %s\n", str1, str2, str3);
}
}