الخطأ
A switch expression or case label must be a bool, char, string, integral, enum, or corresponding nullable type
الحرف د الذي تحته خط هو الخطأ.
الكود
System.Console.WriteLine("Enter //a// value: ");
double a=System.Convert.ToDouble(System.Console.ReadLine());
System.Console.WriteLine("Enter //b// value: ");
double b = System.Convert.ToDouble(System.Console.ReadLine());
System.Console.WriteLine("Enter //c// value: ");
double c = System.Convert.ToDouble(System.Console.ReadLine());
double D = System.Math.Pow(b, 2) - 4 * a * c;
switch (D)
{
case D < 0:
System.Console.WriteLine("Sorry, not exist solution.");
break;
case D = 0:
System.Console.WriteLine(-b/(2*a));
break;
case D > 0:
System.Console.WriteLine((-b+System.Math.Sqrt(D))/(2*a)+" "+(-b-System.Math.Sqrt(D))/(2*a));
break;
}
System.Console.ReadLine();شكرا.