📄 9.4.3.htm
字号:
<html>
<head>
<title>编译原理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link type="text/css" rel="stylesheet" href="../css/specification.css">
</head>
<BODY>
<table align=right width=300>
<tr>
<td><img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='9.4.2.htm'" ></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='9.4.4.htm'" ></img></td>
</tr>
</table>
<br><br>
<font class="title2"><b>9.4.3 内循环</b></font>
<table>
<tr>
<td>    </td>
<td class="content">
<p>
如果把自然循环作为"循环",那么我们有一个实用的性质:
</p>
</td>
</tr>
</table>
<table>
<tr>
<td>    </td>
<td class="content">
<p>
两个循环或者不相交或者一个完全包含(嵌入)在另一个里面,除非它们有相同的首结点。
</p>
</td>
</tr>
</table>
<table>
<tr>
<td>    </td>
<td class="content">
<p>
于是,暂时忽略有相同首结点的情况,<font class = "definition2">内循环</font>的概念是:不包含任何其他循环的循环。
</p>
</td>
</tr>
</table>
<table>
<tr>
<td>    </td>
<td class="content">
<p><img ALIGN=RIGHT src="images/9_1.gif">
当两个循环有相同的首结点时,很难说哪个是内循环。我们举例说明:若B1结尾的测试是<br>
<p> if a=10 goto B2 <br></p>
可能循环{B0,B1,B3}是内循环,但是,如果不详细检查代码,我们不能保证这一点。可能a大多数时候是10,那么在进入B3之前会环绕循环{B0,B1,B2}很多次。所以,我们认为当两个自然循环有相同的首结点,并且不是一个嵌在另一个里面时,把它们合并,看成一个循环。<br>
</td>
</tr>
</table>
<br>
<p> </p>
<table align=right width=300>
<tr>
<td>
<img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='9.4.2.htm'" ></img></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='9.4.4.htm'" ></td>
</tr>
</table>
</BODY>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -