這哪里錯了!為什么老是運行不出來
<script?type="text/javascript"> function?app2(a,b);{ ????if(a>=b){return?a;} ????else{return?b;} ????}//定義函數 //調用函數,實現下面兩組數中,返回較大值。 ??document.write("?5?和?4?的較大值是:"app2(5,4)+"<br>"); ??document.write("?6?和?3?的較大值是:"app2(6,3)""?);? </script>
2016-05-27
要定義變量
function add(x,y)
//定義函數
{?
? ? if(x>y){
return x;}
else if(x<y){
? ? return y;
}
else{
? ? return "same";
}
}
//函數體,判斷兩個整數比較的三種情況
var add1=add(5,4);
var add2=add(6,3);
?
//調用函數,實現下面兩組數中,返回較大值。
? document.write(" 5 和 4 的較大值是:"+add1+"<br>");
? document.write(" 6 和 3 的較大值是:"+add2 );?
2016-05-17
app2(5,4)這個不需要“”的 ?在前面加個+就行了
2016-05-15
docunment app2(x,y) 前后如果加“”都需要加上+
2016-05-14
document.write("?5?和?4?的較大值是:" + app2(5,4) + "<br/>");
document.write("?6?和?3?的較大值是:" + app2(6,3)+ "<br/>"?);
加號沒寫,判斷條件寫a>b
2016-05-13
("6和3較大值是:"app2(6,3));里面的引號有問題
2016-05-13
function app2(a,b)不加;