這樣寫有沒有問題?
<!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>
這節沒寫答案 ?這樣寫可以吧?
2016-10-27
可以。
隨機數*10,或者隨機數四舍五入后再*10都是可以的。
2016-09-28
document.write(Math.round(Math.random()*80 + 20));
Math.random()不加括號,也是可以的。
2016-08-17
可以的