Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- class Program
- {
- static void Main(string[] args)
- {
- double x = double.Parse(Console.ReadLine());
- double a1 = x * x * x * x / 2 / 3 / 4;
- double s0 = double.MinValue;
- double s1 = a1;
- for (int i = 1; Math.Abs(s1 - s0) > double.Epsilon; i++) {
- s0 = s1;
- a1 = a1 * -(x * x * x) / (3 * (i - 1) + 5) / (3 * (i - 1) + 6) / (3 * (i - 1) + 7);
- s1 = s0 + a1;
- }
- Console.WriteLine(s1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement