예제 #1
0
파일: Program.cs 프로젝트: hieucoidk/baitap
 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();
 }