Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- double x, y, eps, a, sum, F;
- int n;
- string s1, s2;
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- eps = 0.0001;
- for (int i = 0; x<=1; i++)
- {
- a = x;
- sum = 0;
- n = 0;
- do
- {
- sum += a;
- y = (Math.Pow(x, 2)) / ((2 * n + 2) * (2 * n + 3));
- a *= y;
- n++;
- } while (Math.Abs(a) >= eps);
- F = (Math.Exp(x) - Math.Exp(-x)) / 2;
- s1 = x.ToString() + " "; s1 = s1.Substring(0, 6);
- s2 = sum.ToString() + " "; s2 = s2.Substring(0, 8);
- listBox1.Items.Add(s1 = "\t" + " " + s2 + " " + "\t" + F);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement