這樣寫(xiě)有沒(méi)有問(wèn)題?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Math </title>
<script type="text/javascript">
document.write(Math.round((Math.random())*10))
</script>
</head>
<body>
</body>
</html>
這節(jié)沒(méi)寫(xiě)答案 ?這樣寫(xiě)可以吧?
2016-10-27
可以。
隨機(jī)數(shù)*10,或者隨機(jī)數(shù)四舍五入后再*10都是可以的。
2016-09-28
document.write(Math.round(Math.random()*80 + 20));
Math.random()不加括號(hào),也是可以的。
2016-08-17
可以的