这样做吗?
int count = 0; for (x=0; x<1000;x++) { if (binaryArray[x] != binaryArray[x+1]) { if (count < 3) nwArray[y]=0; else nwArray[y]=1; y++; count = 0; } else count++; }