public float mul(float x,float y)
{
float z=x*y;
return (z);
}
public static void Main()
{
float x,y,z; Console.WriteLine("x,y:\n");
Console.ReadLine();
z=mul(x,y);
Console.WriteLine("the result is z={0}",z);
}
c:\inetpub\wwwroot\c\a4.cs(27): c:\inetpub\wwwroot\c\a4.cs(27): 非静态的字段、方法或属性“c.a4.mul(float, float)”要求对象引用??
z=mul(x,y);
{
float z=x*y;
return (z);
}
public static void Main()
{
float x,y,z; Console.WriteLine("x,y:\n");
Console.ReadLine();
z=mul(x,y);
Console.WriteLine("the result is z={0}",z);
}
c:\inetpub\wwwroot\c\a4.cs(27): c:\inetpub\wwwroot\c\a4.cs(27): 非静态的字段、方法或属性“c.a4.mul(float, float)”要求对象引用??
z=mul(x,y);
解决方案 »
- InternetSetCookie设置webBrowser的cookie不可用,请大家帮帮忙
- 不能调式了
- C#三层结构DALFactory类厂出现无法反射创建类的问题
- 有没有用C#做过游戏?
- 如何在提交一条记录时验证其有无重复
- 直接复制有水晶报表的程序(windows窗体程序)到客户端,客户端需要装什么软件才能直接运行
- 请教,下面这个正则怎么写
- Winform 最小化托盘问题
- 提问怎么在原来的文件中加入一行!
- 高手帮忙,江湖救急!有关VC程序改成c#程序问题!!!!!!!!!!!!!!
- 简单 逻辑(if)判断 请高手指教 谢谢
- 如何让page_load里面的代码重新执行。也就是说如何让页面动态刷新
public static float mul(float x, float y)
{
float z = x * y;
return (z);
}
public static void Main()
{ float x, y, z; Console.WriteLine("x,y:\n");
Console.ReadLine();
z = mul(x, y);
Console.WriteLine("the result is z={0}", z);
}
可是 z=mul(x,y);测试时提示便用了未赋值的局部变量x,y
如下:
float x=0,y=0,z;
z=mul(x,y);
{
float z = x * y;
return (z);
}
public static void Main()
{ float x = 2, y = 5, z; Console.WriteLine("x,y:\n");
Console.ReadLine();
z = mul(x, y);
Console.WriteLine("the result is z={0}", z);
}