Skip to content

Instantly share code, notes, and snippets.

@sakapon

sakapon/BitArrayTest.cs

Last active Sep 2, 2020
Embed
What would you like to do?
OperatorsSample/BitArrayTest.BitSearch
[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