5-6 比較大小
<!DOCTYPE ?HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>函數(shù)</title>
<script type="text/javascript">
//定義函數(shù)
? function big (x,y){
? ?if (x>y)
? ? {return x};
? ? else if (x<y)
? ? ?{return y};
? ? ?else?
? ? ? {return "一樣大"}
? };
//函數(shù)體,判斷兩個(gè)整數(shù)比較的三種情況
? ?big(5,4)
//調(diào)用函數(shù),實(shí)現(xiàn)下面兩組數(shù)中,返回較大值。
? document.write(" 5 和 4 的較大值是:" big(5,4) +"<br>");
? document.write(" 6 和 3 的較大值是:" big(6,3) ?);
</script>
</head>
<body>
</body>
</html>
大神們。為什么這個(gè)顯示不了
2016-04-11
1、分號(hào)位置錯(cuò)誤;
2、輸出時(shí)漏了“+”。
2016-04-11
目測(cè)輸出時(shí)“document.write(" 5 和 4 的較大值是:" big(5,4) +"<br>");”函數(shù)前少了一個(gè)“+”
2016-04-11
1樓都說完了
2016-04-11
document.write(" 5 和 4 的較大值是:" big(5,4) +"<br>");
document.write(" 6 和 3 的較大值是:" big(6,3) ?);
函數(shù)前少了連接符“+”
試試