*/
double result1;
double result2;
Console.WriteLine("请输入三个数:");
int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
int c = int.Parse(Console.ReadLine());
Console.WriteLine("a={0},b={1},c={2}",a,b,c);
Console.WriteLine("求解 {0}x^2+{1}x+{2}=0 二元方程",a,b,c);
int k = (int)Math.Pow(b, 2) - 4 * a * c;
if (k>= 0)
{
result1 = (-b + Math.Sqrt(k)) / (2 * a);
Console.WriteLine(result1);
result2 = (-b - Math.Sqrt(k)) / (2 * a);
Console.WriteLine(result2);
}
else
Console.WriteLine("无解");