using System;
using System.Windows.Forms;

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

        public static int C(int n, int r)
        {
            if (r == 0 || r == n)
                return 1;
            else
                return C(n - 1, r - 1) + C(n - 1, r);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int n = Convert.ToInt32(textBox1.Text);
            int r = Convert.ToInt32(textBox2.Text);

            MessageBox.Show("C(" + n.ToString() + ", " + r.ToString() + "): " + C(n, r).ToString());
        }
    }
}