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;
- using System.Threading.Tasks;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int i;
- double s = 0.0, sn;
- Double sum = 0;
- Console.WriteLine("Введите N:");
- int n = int.Parse(Console.ReadLine());
- Console.WriteLine("Введите X:");
- double x = double.Parse(Console.ReadLine());
- double q = 1.0;
- for (i = 1; i <= n; i++)
- {
- s += q;
- q *= x*x/ (2 * i);
- Console.WriteLine("n={0} \t q={1} \t Сумма: {2}", i, q, s);
- }
- sn = Math.Cosh(x);
- Console.WriteLine("Сумма: {0}", s);
- Console.WriteLine("Сумма Cosh: {0}", sn);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement