Пример #1
0
 public void Main()
 {
     int n;
     stack s = new stack();
     Console.Write("Nhap n="); n = int.Parse(Console.ReadLine());
     while (n != 0)
     {
         s.push(n % 2);
         n = n / 2;
     }
     while (!s.empty())
         Console.Write(s.pop());
     Console.ReadKey();
 }