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

📄 c32_31.htm

📁 经典c语言教程
💻 HTM
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>练习题</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<script language="javascript">
	function init(){
		err1=err1div.style;
		cor1=cor1div.style;
		hint1=hint1div.style;		
		error1times=0;
	}
	function show(obj){
		obj.display='';
	}
	function hide(obj){
		obj.display='none';
	}


	function judge1(){
		var s1=document.form1.C1.checked;
		var s2=document.form1.C2.checked;
		var s3=document.form1.C3.checked;
		var s4=document.form1.C4.checked;
		var s5=document.form1.C5.checked;
		var s6=document.form1.C6.checked;
		var s7=document.form1.C7.checked;
		var s8=document.form1.C8.checked;
		var s=(!s1)&&(!s2)&&(!s3)&&(!s4)&&s5&&s6&&(!s7)&&(!s8);
		if(s){
			error1times=0;
			hide(hint1);
			hide(err1);
			show(cor1);
		}else{
			error1times++;
			if(error1times==3) show(hint1);
			hide(cor1);
			show(err1);
		}
	}
</script>
</head>

<body bgcolor="#ccefcc" onLoad="init()">

<blockquote>
  <p>请仔细阅读下面的程序: </p>
  <div align="center"><center><table border="6" width="376" cellspacing="0" cellpadding="6"
  height="165" bordercolor="#FF9933">
    <tr>
      <th width="600" bgcolor="#FF9933" height="11">程序</th>
    </tr>
    <tr>
      <td ALIGN="center" width="600" bgcolor="#00FFFF" height="126"><p align="left">1. main()<br>
      2. {<br>
      3.&nbsp;&nbsp; int a[10];<br>
      4.&nbsp;&nbsp; int i,sum=0;<br>
      5.&nbsp;&nbsp; for(i=1;i&lt;=10;i++) scanf(&quot;%d&quot;,&amp;a[i]);<br>
      6.&nbsp;&nbsp; for(i=1;i&lt;=10;i++) sum+=a[i];<br>
      7.&nbsp;&nbsp; printf(&quot;the sum is: %d\n&quot;,sum);<br>
      8. }</td>
    </tr>
  </table>
  </center></div><p>在这个程序中, 哪行有错? 请选择行号:</p>
  <form name="form1">
    <p>1.<input type="checkbox" name="C1" value="ON">&nbsp;&nbsp;&nbsp;&nbsp; 2.<input
    type="checkbox" name="C2" value="ON">&nbsp;&nbsp;&nbsp;&nbsp; 3.<input type="checkbox"
    name="C3" value="ON">&nbsp; 4.<input type="checkbox" name="C4" value="ON">&nbsp; 5.<input
    type="checkbox" name="C5" value="ON">&nbsp; 6.<input type="checkbox" name="C6" value="ON"> 
    &nbsp; 7.<input type="checkbox" name="C7" value="ON">&nbsp; 8.<input type="checkbox"
    name="C8" value="ON"><input type="button" value="确认" name="B1" onClick="judge1()"></p>
  </form>
  <div id="err1div" style="display:'none'"><p><font color="#FF0000">做错了。再做一次!</font> 
  </p>
  </div><div id="cor1div" style="display:'none'"><font color="#FF0000"><p></font><font
  color="#0000FF">正确! 做得很好! </font></p>
  </div><div id="hint1div" style="display:'none'"><p>正确答案是: 5, 6</p>
  </div>
</blockquote>

<p align="center"><a href="javascript:close()">关闭</a></p>
</body>
</html>

⌨️ 快捷键说明

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