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
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double p, q, z, t, a, b, c, A, B;
int n;
A = double.Parse(Console.ReadLine());
B = double.Parse(Console.ReadLine());
a = double.Parse(Console.ReadLine());
b = double.Parse(Console.ReadLine());
c = double.Parse(Console.ReadLine());
n = int.Parse(Console.ReadLine());
double[] f = new double[n];
p = 1;
q = -(a + b + c);
z = a * b + a * c + b * c;
t = -a * b * c;
Console.WriteLine();
int q2 = 0;
double step = (Math.Abs(A) + Math.Abs(B)) / n;
for (double x = A; x <= B; q2++, x += step)
{
f[q2] = p * x * x * x + q * x * x + z * x + t;
int y = (int)(f[q2] * 10000);
f[q2] = y / 10000.0;
Console.WriteLine(f[q2]);
}
}
}
}