Switch语句中的多个控制变量(C) [英] Multiple Control Variables in a Switch Statement (C)
本文介绍了Switch语句中的多个控制变量(C)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在switch语句中包含多个控制变量?
例如:
Is it possible to have multiple control variables in a switch statement?
For example:
展开 | 选择 | Wrap | 行号
推荐答案
是否可以在switch语句中包含多个控制变量?
>
例如:
Is it possible to have multiple control variables in a switch statement?
For example:
展开 | 选择 | Wrap | 行号
不,我不这么认为。你可以用if语句轻松做同样的事情:
Nope, I don''t think so. You can easily do the same thing with if statements though:
展开 | 选择 | Wrap | 行号
否则如果
not
elif
除非它们是预处理程序语句
else if
not
elif
Unless of course they are preprocessor statements
这篇关于Switch语句中的多个控制变量(C)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文