using System using System Collections Generic using System Linq using

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double a = 1.0, b = 0.0, x, y = 0.0;
do
{
x = (a + b) / 2;
if (x > 0) b = x;
else if (x < 0) a = x;
y = Math.Exp(x) - Math.Exp(-x) - 2;
if (x == a)
{
break;
}
Console.WriteLine("x = {0:f2} и лежит в отрезке [0,1] | Ответ: y = {1:f4}", x, y);
}
while (Math.Abs(y) > 0.0001);
Console.ReadKey();
}
}
}