哭了,急啊,计算机专业英语翻译
The switch keyword is followed by an expression enclosed in parentheses
(yes, the name of an object serves as an expression). The expression
must evaluate to an integral value. A series of case labels follows the
switch keyword, each specifying a constant expression. The result of the
expression is compared against each case label in turn. If there is a
match, the statements following the case label are executed. If there is
no match and the default label is present, the statements following the
default label are executed. If there is no match and no default label,
nothing happens.
参考答案:我来试一下啊,主要是解释
switch(value)
{
case 0:
语句;
break;
case 1:
语句;
break;
default:
语句;
break;
}这样一个东东
关键字switch后跟着一对括号,括号中是一个表达式,这个表达式必须是一个整数值.在switch后面是一系列的case标签,每个标签后跟着一个常量,表达式的值(即上面的value)与每一个case后的常量比较,如果匹配则执行case后面的语句.如果没有匹配且当前的是default标签则执行default后面的语句,如果没有匹配也没有default标签则不做任何事