日期:2014-05-20  浏览次数:20727 次

switch 问题?急!!!!!
string   sign;
string   sign2;
switch(sign   ||   sign2
{
      case   1;
      case   2;
}
有这么比较的吗     那得怎么比较

------解决方案--------------------
string sign = "1 ";
string sign2 = "2 ";
switch (sign != " " || sign2 != " ")
{
case true:
Text = "true ";
break;
case false:
Text = "false ";
break;
}
switch (sign.CompareTo(sign2))
{
case 0:
Text = "0 ";
break;
case -1:
Text = "-1 ";
break;
case +1:
Text = "+1 ";
break;
}

------解决方案--------------------
认同上面这位兄弟的!
------解决方案--------------------
int s;
if(sign==1|| sign2==1)
{
s=1;
}
else if(sign==7||sign2==7)
{
s=7;
}
switch(s)
{
case 1;
case 2;
}