问答详情
源自:7-16 随机数 random()

这个是哪里有问题

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Math </title>

<script type="text/javascript">

var a = (Math.round())*10;

document.write(Math.round(a));

</script>

</head>

<body>

</body>

</html>


提问者:慕雪9588076 2017-10-06 11:20

个回答

  • 慕设计8515454
    2018-06-29 10:54:49

    var a = Math.random()*10;

  • qq_Rainy小迪_0
    2017-10-18 13:45:46

    把var a = (Math.round())*10;改为:var a = (Math.random())*10;

  • 慕函数7241962
    2017-10-06 14:03:10

    "var a = (Math.round())*10;"随机函数代码生成为Math.random()