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

📄 c12_21.htm

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

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>练习题一 </title>
<script language="javascript">
	function init(){
		cor=cordiv.style;
		err=errdiv.style;
		hint=hintdiv.style;
		errortimes=0;
	}

	function show(obj){
		obj.display='';
	}
	function hide(obj){
		obj.display='none';
	}
	function judge(){
		var inp=document.form.input;
		if(inp.value=="float f;"){
			errortimes=0;
			hide(hint);
			hide(err);
			show(cor);
		}
		else{
			errortimes++;
			if(errortimes==3)	show(hint);
			hide(cor);
			show(err);
		}
	}
</script>
</head>

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

<blockquote>
  <p>请看这里给出的几个变量说明: <br>
  int a;<br>
  char b;<br>
  请你试着写其它的说明语句。<br>
  例如: <br>
  请写出说明 int 型变量 x 的 说明语句。<br>
  正确的答案是<br>
  int x;<br>
  <br>
  请写出说明 float 型变量 f 的说明语句。</p>
  <form name="form">
    <p>回答:<input type="text" name="input" size="20"><input type="button" value="Enter"
    name="B1" onClick="judge()"></p>
  </form>
  <div id="errdiv" style="display:'none'"><p><font color="#FF0000">错误! 再做一次!</font> 
  </p>
  </div><div id="cordiv" style="display:'none'"><p><font color="#0000FF">正确! 
  做的很好! </font></p>
  </div><div id="hintdiv" style="display:'none'"><p>正确的答案是:<br>
  float f; </p>
  </div>
</blockquote>

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

⌨️ 快捷键说明

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