<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.0//EN""http://www.w3.org/TR/REC-html140/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<title>数学运算符</title>
<script language="javascript" type="text/javascript">
<!--
//设定初始值
var lValue = 25;
var rValue = 4;
//响应按钮的onclick事件处理程序
function Test(){
var tempData = 0;
var msg = "/n基本数学运算符:";
msg += "原始数值:/n/ntempData=" + tempData + " lValue=" + lValue + " rValue=" + rValue + "/n/n";
msg += "操作语句及返回结果:/n/n";
tempData = lValue + rValue;
msg += "语句:tempData=lValue+rValue 结果:tempData=" + tempData + "/n";
tempData = lValue - rValue;
msg += "语句:tempData=lValue-rValue 结果:tempData=" + tempData + "/n";
tempData = lValue * rValue;
msg += "语句:tempData=lValue*rValue 结果:tempData=" + tempData + "/n";
tempData = lValue / rValue;
msg += "语句:tempData=lValue/rValue 结果:tempData=" + tempData + "/n";
tempData = lValue % rValue;
msg += "语句:tempData=lValue%rValue 结果:tempData=" + tempData + "/n";
alert(msg);
}
-->
</script>
</head>
<body bgcolor="green">
<center>
<form>
<input type="button" value="数学运算符测试:" οnclick="Test()">
</form>
</center>
</body>
</html>
数学运算符
最新推荐文章于 2024-09-02 21:59:28 发布