using System; class MainClass { public static void Main (string[] args) { for (double x = -3; x <= 1; x += 0.1) { double y = 4 * Math.Pow(x, 3) - 2 * Math.Pow(x, 2) + 5; Console.WriteLine($"x = {x}, y = {y}"); } } }
Результат:
x = -3, y = -113 x = -2.9, y = -97.81 x = -2.8, y = -83.04 x = -2.7, y = -68.61 x = -2.6, y = -54.36 x = -2.5, y = -40.19 x = -2.4, y = -25.96 x = -2.3, y = -11.51 x = -2.2, y = 3.36 x = -2.1, y = 18.59 x = -2, y = 34 x = -1.9, y = 49.69 x = -1.8, y = 65.76 x = -1.7, y = 82.31 x = -1.6, y = 99.44 x = -1.5, y = 117.25 x = -1.4, y = 135.84 x = -1.3, y = 155.31 x = -1.2, y = 175.76 x = -1.1, y = 197.29 x = -1, y = 220 x = -0.9, y = 244.99 x = -0.8, y = 272.36 x = -0.7, y = 302.21 x = -0.6, y = 334.64 x = -0.5, y = 369.75 x = -0.4, y = 407.64 x = -0.3, y = 448.41 x = -0.2, y = 492.16 x = -0.1, y = 538.99 x = 0, y = 589 x = 0.1, y = 642.29 x = 0.2, y = 698.96 x = 0.3, y = 759.11 x = 0.4, y = 822.84 x = 0.5, y = 890.25 x = 0.6, y = 961.44 x = 0.7, y = 1036.51 x = 0.8, y = 1115.56 x = 0.9, y = 1198.69 x = 1, y = 1286
class MainClass {
public static void Main (string[] args) {
for (double x = -3; x <= 1; x += 0.1) {
double y = 4 * Math.Pow(x, 3) - 2 * Math.Pow(x, 2) + 5;
Console.WriteLine($"x = {x}, y = {y}");
}
}
}
Результат:
x = -3, y = -113x = -2.9, y = -97.81
x = -2.8, y = -83.04
x = -2.7, y = -68.61
x = -2.6, y = -54.36
x = -2.5, y = -40.19
x = -2.4, y = -25.96
x = -2.3, y = -11.51
x = -2.2, y = 3.36
x = -2.1, y = 18.59
x = -2, y = 34
x = -1.9, y = 49.69
x = -1.8, y = 65.76
x = -1.7, y = 82.31
x = -1.6, y = 99.44
x = -1.5, y = 117.25
x = -1.4, y = 135.84
x = -1.3, y = 155.31
x = -1.2, y = 175.76
x = -1.1, y = 197.29
x = -1, y = 220
x = -0.9, y = 244.99
x = -0.8, y = 272.36
x = -0.7, y = 302.21
x = -0.6, y = 334.64
x = -0.5, y = 369.75
x = -0.4, y = 407.64
x = -0.3, y = 448.41
x = -0.2, y = 492.16
x = -0.1, y = 538.99
x = 0, y = 589
x = 0.1, y = 642.29
x = 0.2, y = 698.96
x = 0.3, y = 759.11
x = 0.4, y = 822.84
x = 0.5, y = 890.25
x = 0.6, y = 961.44
x = 0.7, y = 1036.51
x = 0.8, y = 1115.56
x = 0.9, y = 1198.69
x = 1, y = 1286