int a;
int b;
int c;
double f;
double s;
Console.Write("Enter a : ");
a = int.Parse(Console.ReadLine());
Console.Write("Enter b : ");
b = int.Parse(Console.ReadLine());
Console.Write("Enter c : ");
c = int.Parse(Console.ReadLine());
f = (-b + Math.sqrt(b * b - 4 - *a * c)) / 2;
s = (-b - Math.sqrt(b * b - 4 - *a * c)) / 2;
if (-4 * a * c > 0) Console.WriteLine("There are two solutions, the solutions are : " + f + " and " + s);
if (-4 * a * c < 0) Console.WriteLine("the isn't any solution");
if (-4 * a * c = 0) Console.WriteLine("There is ont solution, the solution is : " + f);
לא הוא לא עובד ?
f = x1
s = x2 |