//Решение R2 private void R2() { int q, w, e; if (Int32.TryParse(R2CountBox.Text, out q) && Int32.TryParse(ABox.Text, out w) && Int32.TryParse(BBox.Text, out e) && q > 0 && w > 0 && e > 0 && e > w) { R2Box.Items.Clear(); chartR2.Series["Числа"].Points.Clear(); chartR2.Series["График"].Points.Clear(); int A = Convert.ToInt32(ABox.Text), B = Convert.ToInt32(BBox.Text);; int n = Convert.ToInt32(R2CountBox.Text); R2 r2 = new R2(); r2.SolveR2(n, A, B); for (int i = 0; i < r2.list.Count; i++) { R2Box.Items.Add(r2.list[i]); } foreach (var i in r2.Dic) { chartR2.Series["График"].Points.AddXY(i.Key, i.Value); chartR2.Series["Числа"].Points.AddXY(i.Key, i.Value); } } }