switch与if else的转换

img

img


怎样把用if else的嵌套语句表示?把switch与ifelse互换。

直接把 swtich 替换成如下即可:

    if (c == 0)
    {

    } 
    else if (c == 1) 
    {

    }
    else if (c >=2 && c <=3)
    {

    }
    else if (c >= 4 && c <=7)
    {
        
    }
    else  // 。。。其他类似