if else else语句能不能执行多个分支,还是说条件都满足只执行一个

如题所述

按顺序来
int i = 4;
if (i > 0)
...
else if (i > 1)
...
else if (i > 2)
...
只会执行到 i > 0 那段
温馨提示:答案为网友推荐,仅供参考