static float area(float r)
{
float PI = 3.1415926F;
float mj = PI * r * r;
//Console.WriteLine(mj);
//加上
return mj;
}
static void Main()
{
//area(10);
//改为
float mj=area(10);
Console.WriteLine(mj); }
}
如果不想改Main函数里面的内容就将static float area(float r)
改为:static void area(float r)无返回值