[ create a new paste ] login | about

Link: http://codepad.org/oVTfuPgw    [ raw code | output | fork ]

C, pasted on Nov 24:
#include <stdio.h>
int main(void)
{
  int i, j, n, cnt[64] = {0};
  char a[8 * 256 + 4] = {0}, b[8] = {0};
  for(i = 0; ; ) {
    for(j = 0; j < 8; j++) a[i++] = b[j];
    if(i == 8 * 256) break;
    for(j = 7; (b[j] ^= 1) == 0; j--);
  }
  for(i = 0; i < 342; i++) {
    for(j = n = 0; j < 6; j++) n = n * 2 + a[i * 6 + j];
    cnt[n]++;
  }
  for(i = 0; i < 6; i++) b[i] = 0;
  for(i = 0; ; i++) {
    for(j = 0; j < 6; j++) printf("%d", b[j]);
    printf(" %d回\n", cnt[i]);
    if(i == 63) break;
    for(j = 5; (b[j] ^= 1) == 0; j--);
  }
  return 0;
}


Output:
000000 6回
000001 5回
000010 5回
000011 6回
000100 5回
000101 5回
000110 6回
000111 5回
001000 5回
001001 6回
001010 5回
001011 5回
001100 6回
001101 5回
001110 5回
001111 6回
010000 5回
010001 5回
010010 6回
010011 5回
010100 5回
010101 6回
010110 5回
010111 5回
011000 6回
011001 5回
011010 5回
011011 6回
011100 5回
011101 5回
011110 6回
011111 5回
100000 5回
100001 6回
100010 5回
100011 5回
100100 6回
100101 5回
100110 5回
100111 6回
101000 5回
101001 5回
101010 6回
101011 5回
101100 5回
101101 6回
101110 5回
101111 5回
110000 6回
110001 6回
110010 5回
110011 5回
110100 6回
110101 5回
110110 5回
110111 6回
111000 5回
111001 5回
111010 6回
111011 5回
111100 5回
111101 5回
111110 6回
111111 5回


Create a new paste based on this one


Comments: