Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- double x, y=0,t;
- int n=0, k = 0;
- Console.WriteLine("Введите xn");
- double xn=double.Parse(Console.ReadLine());
- Console.WriteLine("Введите xk");
- double xk=double.Parse(Console.ReadLine());
- Console.WriteLine("Введите dx");
- double dx=double.Parse(Console.ReadLine());
- Console.WriteLine("Введите e");
- double e=double.Parse(Console.ReadLine());
- Console.WriteLine("| X | Y | K |");
- for (x=xn;x<=xk;x+=dx)
- {
- if (x > 1)
- {
- do
- {
- t=Math.PI/2+((Math.Pow(-1,n+1))/((2*n+1)*(Math.Pow(x,(2*n+1)))));
- y=y+t;
- n++;
- k++;
- }while (t>=e);
- Console.WriteLine("{0,20}|{1,20}|{2,20}", x,Math.Round(y,8), k);
- k = 0;
- }
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement