c#重载运算符必须成对出现,而且必须定义为是public staticpublic struct Ranking
{
string name; //名字
int loops; //圈数
int point; //已经到达的 ID public static bool operator >= (Ranking x, Ranking y)
{
if (x1.loops >= y.loops)
{
return true;
}
return false;
} public static bool operator <= (Ranking x, Ranking y)
{
if (x1.loops <= y.loops)
{
return true;
}
return false;
}
}
{
string name; //名字
int loops; //圈数
int point; //已经到达的 ID public static bool operator >= (Ranking x, Ranking y)
{
if (x1.loops >= y.loops)
{
return true;
}
return false;
} public static bool operator <= (Ranking x, Ranking y)
{
if (x1.loops <= y.loops)
{
return true;
}
return false;
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货