switch-case流程图

第一种情况:每一个case后面都有break

switch (p)
{
    case 1:
        process 1
        break;
    case 2:
        process 2
        break;
    ...
    case n:
        process n
        break;
    default:
        process n+1
}
Created with Raphaël 2.1.0开始pp==1?process 1结束p==2?process 2......p==n?process nprocess n+1yesnoyesnoyesnoyesno

第二种情况:每一个case后面不一定有break

例如:case1和case2都执行process 1&2

switch (p)
{
    case 1:
    case 2:
        process 1&2
        break;
    case n:
        process n
        break;
    default:
        process n+1
}
Created with Raphaël 2.1.0开始pp==1?process 1&2结束p==2?p==n?process nprocess n+1yesnoyesnoyesno

你可能感兴趣的:(c语言,流程图,switch,case)