Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace _4._4
- {
- class Program
- {
- static double F(double i, int n)
- {
- return 1+Math.Pow(-i, 2 * n) / (n * (n + 2) * (n + 3));
- }
- static void Main(string[] args)
- {
- Console.Write("Введите точность e: ");
- double e = double.Parse(Console.ReadLine());
- double s = 0, h = 0.1;
- double i = 0.2, a = 1;
- int n = 1;
- Console.WriteLine("Значение x\tЗначение функции F(x)\tКоличество просуммированных слагаемых n");
- while (Math.Abs(a) >= e && i <= 0.7)
- {
- Console.WriteLine("{0:0000}\t{1:0000}\t{2:0000}", i, F(i, n), n + 1);
- a /= F(i, n);
- s += a;
- i+=h;
- n++;
- }
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment