我已经把这段代码弄乱了一个多小时,试图以不同的方式重新排列它。有没有更简单的写法?
if x is not Number ;// if x is string
{
if y is not Number ;// x, y both strings
{
Eval(x)
Eval(y)
return
}
else ;// x is string, y is Number
{
Eval(x)
Scale(y)
return
}
}
else if y is not Number ;// x is Number, y is string
{
Scale(x)
Eval(y)
return
}
else ;// both are numbers
{
Scale(x)
Scale(y)
return
}