using System;
using System.Windows.Forms;

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

        int Fact(int n)
        {
            int f = 1;
            for (int i = 1; i <= n; i++)
                f = f * i;
            return f;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            double C = 0;
            int n = Convert.ToInt32(textBox1.Text);
            int r = Convert.ToInt32(textBox2.Text);
            C = (double)(Fact(n) / (Fact(r) * Fact(n - r)));

            MessageBox.Show(C.ToString());
        }
    }
}