2016-06-15 11 views

Antwort

0
for (int i= 0; i < 32; i++) 
{ 
    // i is a packed combination 
    // j-th bit is (i >> j) & 1 
} 
2

Eine einfache Google-Suche würden Sie wahrscheinlich die Antwort bekommen, aber wenn Sie nur die binäre Darstellung von Zahlen von 0 bis 32.

public static void Main() 
    { 
     for (int i = 0; i < 32; i++) 
     Console.WriteLine(Convert.ToString(i, 2).PadLeft(5, '0')); 
    }