<!DOCTYPE HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>函数</title>
<script type="text/javascript">
//定义函数
function com(a,b){
if(a>b)
{
document.write(a);
}
else if(a<b)
{
document.write(b);
}
else
{
document.write("一样大");
}
}
//函数体,判断两个整数比较的三种情况
//调用函数,实现下面两组数中,返回较大值。
document.write(" 5 和 4 的较大值是:"+com(5,4)"<br>");
document.write(" 6 和 3 的较大值是:"+ com(6,3));
</script>
</head>
<body>
</body>
</html>__innocence
相关分类