using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace bai_9_sgkt36
{
class Program
{
static void Main(string[] args)
{
int[] a = new int[1000];
int n;
int i = 0;Console.Write("nhap so muon doi co so="); n = int.Parse(Console.ReadLine());
while (n != 0)
{
a[i] = n % 2;
n = n / 2;
i++;
}
for (int j = i; j >=0; j--)
Console.Write(a[j] + "\t");
Console.ReadKey();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace bai_9_sgkt36
{
class Program
{
static void Main(string[] args)
{
int[] a = new int[1000];
int n;
int i = 0;Console.Write("nhap so muon doi co so="); n = int.Parse(Console.ReadLine());
while (n != 0)
{
a[i] = n % 2;
n = n / 2;
i++;
}
for (int j = i; j >=0; j--)
Console.Write(a[j] + "\t");
Console.ReadKey();
}
}
}