帮忙翻译哭了哦我int max_tries = 3; int tries_cnt = 0; while ( tries_cnt < max_tries ) { // read user guess if ( usr_guess == next_elem ) break; // terminate loop tries_cnt++; // more stuff } The program can short-circuit
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/08 06:02:39
帮忙翻译哭了哦我int max_tries = 3; int tries_cnt = 0; while ( tries_cnt < max_tries ) { // read user guess if ( usr_guess == next_elem ) break; // terminate loop tries_cnt++; // more stuff } The program can short-circuit
帮忙翻译哭了哦我
int max_tries = 3;
int tries_cnt = 0;
while ( tries_cnt < max_tries )
{
// read user guess
if ( usr_guess == next_elem )
break; // terminate loop
tries_cnt++;
// more stuff
}
The program can short-circuit execution of the current iteration of the
loop by executing a continue statement. For example, consider the
following program fragment in which all words of fewer than four characters
are discarded:
帮忙翻译哭了哦我int max_tries = 3; int tries_cnt = 0; while ( tries_cnt < max_tries ) { // read user guess if ( usr_guess == next_elem ) break; // terminate loop tries_cnt++; // more stuff } The program can short-circuit
int max_tries = 3;
int tries_cnt = 0;
while ( tries_cnt < max_tries )
{
// read user guess 读取用户猜想
if ( usr_guess == next_elem )
break; // terminate loop 循环结束(用户猜对了)
tries_cnt++;
// more stuff
}
这个程序通过continure语句来能缩短循环
比如,当程序标识少于4个字母时,不予处理
你给的都翻了,不过程序似乎不完整啊
内部max_tries = 3;
内部tries_cnt = 0;
当(tries_cnt < max_tries)
{
//读用户猜测
如果(usr_guess == next_elem)
断裂; //终止圈
tries_cnt++;
//更多材料
}
节目可能短路当前的叠代的施行
圈由执行继续声明。例如, ...
全部展开
内部max_tries = 3;
内部tries_cnt = 0;
当(tries_cnt < max_tries)
{
//读用户猜测
如果(usr_guess == next_elem)
断裂; //终止圈
tries_cnt++;
//更多材料
}
节目可能短路当前的叠代的施行
圈由执行继续声明。例如, 考虑
随后而来的节目片段所有较少比四个字符的词
被摈除:
收起