[求助]函数调用出错!
错误 1 非静态的字段、方法或属性“sanjiaoxing.Program.qwx(string)”要求对象引用我的代码
namespace sssssss
{
class Program
{
int s;
string qwx(string w)
{
if (int.TryParse(w, out s))
{
return "right";
}
else
{
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("输入数据“{0}”有误,:", w);
Console.ForegroundColor = ConsoleColor.White;
return "wrong";
}
}
static void Main(string[] args)
{
while (true)
{
int a, b, c;
string a1, b1, c1,a2,b2,b3;
Console.Write("\n");
Console.ForegroundColor = ConsoleColor.White;
while (true)
{
Console.WriteLine("请输入第1数:");
a1 = Console.ReadLine();
a2 =qwx(a1);
if (a2 == "right")
{
break;
}
else
{
continue;
}
}
}
}
}
}
请大家帮忙!
来源: http://www.