よく考えたらdigitいらなかったw

#include <stdio.h>

#define N 8

int main(void)
{
int i;
char a[N] = {0};

while(1) {
for(i=0; !(a[i++]^=1);) if(i==N) goto end;
for(i=N-1; i>=0; i--) printf("%d", a[i]);
putchar('\n');
}
end:

return 0;
}