錯了的可以參考一下
<!DOCTYPE? HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>函數(shù)</title>
<script type="text/javascript">
//定義函數(shù)
function str(a,b){
? ? if(a>b){
? ? ? ? return a
? ? }else if(a<b){
? ? ? ? return b
? ? }else{
? ? ? ? return '相等';
? ? }
//函數(shù)體,判斷兩個整數(shù)比較的三種情況
}
//調(diào)用函數(shù),實現(xiàn)下面兩組數(shù)中,返回較大值。
? document.write(" 5 和 4 的較大值是:"+str(5,4)+"<br>");
? document.write(" 6 和 3 的較大值是:"+str(6,3)+"<br>" );
? document.write(" 8 和 8 相等嗎:"+str(8,8)+"<br>" );?
</script>
</head>
<body>
</body>
</html>
2018-10-31
哈哈。系統(tǒng)推薦來的,讓我回答問題,賊忐忑。一看原來是,教學的,白拿分了。哈哈哈哈哈哈。