1.3.5 #解答 #实际上是用除二取余法求一个十进制数的二进制形式。代码 #var n = 50; var stack = new Stack<int>(); while (n > 0) { stack.Push(n % 2); n = n / 2; } foreach (var d in stack) { Console.WriteLine(d); } Console.WriteLine(); 另请参阅 #Generics 库