⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 while

📁 C实现的MUD,对大家基本入门网络游戏很有帮助!
💻
字号:
The LPC while loop:

LPC's while loop is identical to that provided by C.  Syntax is as follows:

while (expression)
	statement;	

where statement may be replaced by a block of statements delimited by
matching curly brackets.  For example:

while (expression) {
	statement0;
	statement1;
}

The statements inside the body of the while loop will be executed
repeatedly for as long as the test expression evaluates to non-zero.
If the test expression is zero just prior to the execution of the loop,
then the body of the loop will not be executed.  A 'break;' statement
in the body of the loop will terminate the loop (skipping any statements
in the loop that remain to be executed).  A 'continue;' statement
in the body of the loop will continue the execution from the beginning
of the loop (skipping the remainder of the statements in the loop for
the current iteration).

int test(int limit)
{
	total = 0;
	j = 0;
	while (j < limit) {
		if ((j % 2) != 0)
			continue;
		total += j;
		j++;
	}
	return total;
}

The results of this code fragment will be to sum all of the even numbers
from 0 to to limit - 1. 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -