问答详情
源自:5-6 编程练习

怎么输出大的数,需要修改哪里

<!DOCTYPE  HTML>

<html >

<head>

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

<title>函数</title>


<script type="text/javascript">


function a(x,y){

    var x=parseInt(prompt("请输入x"));

    var y=parseInt(prompt("请输入y"));

    if(x>y){

        return x;

    }else if(x=y){

        return "两数相等";

    }else{

        return y;

    }

  


document.write(x+"和"+y+"的最大值是"+a(x,y)+"<br>");





</script>

</head>

<body>

    <form>

</body>

</html>



提问者:静静好吗 2017-02-02 16:38

个回答

  • 慕粉4059587
    2017-02-02 17:05:10

    <!DOCTYPE  HTML>

    <html >

    <head>

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

    <title>函数</title>


    <script type="text/javascript">


        var x=parseInt(prompt("请输入x"));

        var y=parseInt(prompt("请输入y"));

        

    function a(x,y){

        

        if(x>y){

            return x;

        }else if(x==y){

            return "两数相等";

        }else{

            return y;

        }

      


    document.write(x+"和"+y+"的最大值是"+a(x,y)+"<br>");

    </script>

    </head>

    <body>

    </body>

    </html>