Advertisement
Dam4eeeg

Untitled

Apr 8th, 2020
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace _4_лаба_сумма_ряда_1_семестр_
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.  
  19.         private void Form1_Load(object sender, EventArgs e)
  20.         {
  21.  
  22.         }
  23.  
  24.         private void label1_Click(object sender, EventArgs e)
  25.         {
  26.  
  27.         }
  28.  
  29.         private void button1_Click(object sender, EventArgs e)
  30.         {
  31.             const double eps = 0.00001;
  32.             double x;
  33.             double summ = 0.0;
  34.             x = Convert.ToDouble(textBox1.Text);
  35.             double j = ((14 * x * x) / (27));
  36.             for (Int32 n=2; eps <= j && n<=14; n++)
  37.             {
  38.                 j = ((14 * x * x) / (27 * n));
  39.                 summ = summ += j;
  40.             }
  41.             label3.Text = Convert.ToString(summ);
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement