using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        struct M_D_2
        {
            private float _a, _b, _c;
            private float delta;
            void calc_delat()
            {
                delta = (float)Math.Pow(_b, 2) - 4 * _a * _c;
            }            
            public float x1 { get { return (float)(-_b + Math.Sqrt(delta)) / (2 * _a); } }
            public float x2 { get { return (float)(-_b - Math.Sqrt(delta)) / (2 * _a); } }
            public float a { set { _a = value; calc_delat(); } }
            public float b { set { _b = value; calc_delat(); } }
            public float c { set { _c = value; calc_delat(); } }
            public float GetDelta()
            {
                return delta;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            M_D_2 m = new M_D_2();
            m.a = float.Parse(textBox1.Text);
            m.b = float.Parse(textBox2.Text);
            m.c = float.Parse(textBox3.Text);
            if (m.GetDelta() == 0)
                MessageBox.Show(m.x1.ToString());
            else
                if (m.GetDelta() > 0)
                    MessageBox.Show(m.x1.ToString() + "\n" + m.x2.ToString());
                else
                    MessageBox.Show("No Roots");
        }
    }
}
