Advertisement
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("{0,10} {1,20} {2,10}", "Значение x", "Значение функции F(x)", "Количество просуммированных слагаемых n");
- while (Math.Abs(a) >= e && i <= 0.7)
- {
- Console.WriteLine("{0,10}\t{1,20}\t{2,10}", i, a /*F(i, n)*/, n + 1);
- //a /= F(i, n);
- a += i * i * (3 * i * i - 10) / 120;
- s += a;
- i += h;
- n++;
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement