📄 c72_ex.htm
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>练习题 </title>
<script LANGUAGE="JavaScript">
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
function init() {
if (ns4) correct = document.correctDiv
if (ie4) correct = correctDiv.style
if (ns4) error = document.errorDiv
if (ie4) error = errorDiv.style
}
function showObject(obj) {
if (ns4) obj.visibility = "show"
else if (ie4) obj.visibility = "visible"
}
function hideObject(obj) {
if (ns4) obj.visibility = "hide"
else if (ie4) obj.visibility = "hidden"
}
</script>
</head>
<body bgcolor="#ccefcc" onLoad="init()">
<blockquote>
<blockquote>
<div align="center"><center><table border="6" width="376" cellspacing="0" cellpadding="6"
height="150" bordercolor="#FF9933">
<tr>
<th width="600" bgcolor="#FF9933">程序</th>
</tr>
<tr>
<td ALIGN="center" width="600" bgcolor="#00FFFF"><p align="left">main()<br>
{<br>
if ( "abc" == "abc" )<br>
{<br>
printf("The two are the same.\n");<br>
}<br>
else<br>
{<br>
printf("The two are not the same.\n");<br>
}<br>
}</td>
</tr>
</table>
</center></div><p align="center">提问: 程序的结果是什么?<br>
请从下面给出的答案中选择 ( 1 或 2 ):</p>
</blockquote>
</blockquote>
<div align="center"><center>
<table border="0" width="68%" height="127" cellspacing="4" cellpadding="4">
<tr>
<td width="50%" height="18" align="left"><a
href="javascript:hideObject(correct);showObject(error)"><font color="#0000FF">1.The two
are the same.</font></a></td>
<td width="50%" height="18" align="left"><a
href="javascript:hideObject(error);showObject(correct)"><font color="#0000FF">2.The two
are not the same.</font></a></td>
</tr>
<tr>
<td width="50%" height="101" align="left"><div id="errorDiv" style="visibility:hidden"><p>错误!<br>
虽然两个字符串外表相同, 但由于它们在内存中存放了两次。
而字符串表达式的值是该串的起始地址。因此,
正在比较的是两个地址, 而不是这些地址上的字符串。因此,
你应选择的答案是 2。<br>
</p>
</div></td>
<td width="50%" height="101" align="left"><div id="correctDiv" style="visibility:hidden"><p>正确!<br>
在程序第三行比较的是两字符串的起始地址, 它们不可能相同。<br>
</p>
</div></td>
</tr>
</table>
</center></div>
<p align="center"><a href="javascript:close()">关闭</a></p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -