Last active
September 2, 2020 01:29
-
-
Save sakapon/06d170b712990531022ed577ba051a37 to your computer and use it in GitHub Desktop.
OperatorsSample/BitArrayTest.BitSearch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void BitSearch() | |
{ | |
var n = 8; | |
var n2 = 1 << n; // 256 | |
// bit 全探索 | |
for (BitArray b = 0; b.Value < n2; b++) | |
{ | |
for (int i = 0; i < n; i++) | |
{ | |
// b[i] の真偽による何らかの処理 | |
Console.Write(b[i] ? 1 : 0); | |
} | |
Console.WriteLine(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment