using System;
using System.Windows.Forms;

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

        public static int Fib(int n)
        {
            if (n == 1)
                return 0;
            else if (n == 2)
                return 1;
            else
                return Fib(n - 1) + Fib(n - 2);
        }


        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != string.Empty)
            {
                textBox2.Clear();
                int n = Convert.ToInt32(textBox1.Text);

                for (int i = 1; i <= n; i++)
                {
                    textBox2.AppendText(Fib(i).ToString());
                    textBox2.AppendText("\t");
                }
            }
        }
    }
}