using System;
using System.Windows.Forms;

namespace _7_15
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        public static string Rev(string str)
        {
            string rev = string.Empty;
            
            for (int i = str.Length - 1; i >= 0; i--)
                rev += str[i];
            
            return rev;
        }

        public static string DecToBin(int n)
        {
            string str = string.Empty;
            
            while (n > 0)
            {
                int i = n % 2;
                str += i.ToString();
                n /= 2;
            }
            
            return (Rev(str));
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int n = Convert.ToInt32(textBox1.Text, 10);
            
            MessageBox.Show(DecToBin(n));
        }
    }
}