📄 h.while
字号:
* * * * * * * * while * * * * * * * * "while-loop" SYNTAX: while(B, seq) B is a boolean expression. seq is executed, while the value of B is nonzero. seq is a sequence of several expressions, separated by '_' or ';'. If an expression ends with '_', its output is displayed, if it ends with ';', its output is suppressed. The sequence must not be empty. Remark: The last expression of seq must not be terminated by '_' and need not be terminated by ';'. If you want its output to be suppressed, terminate it by ';'. To avoid the output of unnecessary results during the computation, please use ';'. At the end of the outermost loop, the values of all variables used during the computation are displayed. Endless loops are not recognized. Type "CTRL/C" to interrupt the loop. In that case, the value of all variables are displayed. The overwrite protection mechanism is automatically disabled in a loop. At the end of the loop, it is restored. If an error occurs, the user is asked, if the loop should be continued. If the answer is positive, the actual loop is continued, else the loop is left. "break" and "continue" may be used (see "? break","? continue"). Example 1: (correct) while(a > 0, fact(a)_a=a-1;) Example 2: (correct) while(a>=(-5), if(a>=0,b=sqrt(a),break)_a=a-1;) Example 3: (incorrect) while( t>2, r=3, t=t-1 )_ERR_NR_232
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -