在下面给出的程序中,Math.Sqrt 函数抛出一个错误,即“表达式表示variable', where a
方法组是预期的”。这里似乎有什么问题?
using System;
class program{
static void Main(){
Console.WriteLine("Enter the sides(a,b,c) of a triangle :");
int a = Convert.ToInt16(Console.ReadLine());
int b = Convert.ToInt16(Console.ReadLine());
int c = Convert.ToInt16(Console.ReadLine());
double s = (a+b+c)/2;
double area = Math.Sqrt(s(s-a)(s-b)(s-c));
if (a==b&&b==c){
Console.WriteLine("This is an Equilateral trangle");
}
else if(a==b&&b!=c||a!=b&&b==c){
Console.WriteLine("This is an Isosceles trangle");
}
else{
Console.WriteLine("This is an Scalene trangle");
}
}
}here