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
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication45
{
classProgram
{
static void Main(string[] args)
{
double y, a = 2.8, b = -0.3, c = 4;
Console.WriteLine("Введите x");
Продолжение листинга 2
double x = Convert.ToInt32(Console.ReadLine());
for (x = 1; x <= 2; x += 0.05)
{
if (x < 1.2)
{
y = (a * Math.Pow(x, 2) + (b * x) + c);
}
else if (x == 1.2)
{
y = (a / x + Math.Sqrt(Math.Pow(a, 2) + 1));
}
else
{
y = (a + b * x) / Math.Sqrt(Math.Pow(x, 2) + 1);
}
Console.WriteLine("y=" + y);
}
Console.ReadLine();
}
}
}