练习3

作者: 张露锋 | 来源:发表于2018-12-02 19:12 被阅读0次
    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8" />
            <title>if练习3</title>
            <script type="text/javascript">
                var num1 = +prompt("请输入第一个数:");
                var num2 = +prompt("请输入第二个数:");
                var num3 = +prompt("请输入第三个数:");
    
                alert(typeof num1);
                if(num1 < num2 && num1 < num3){
                    
                    if(num2 < num3){
                        alert(num1 +","+num2 + ","+num3);
                    }else{
                        alert(num1 +","+num3 + ","+num2);
                    }
                    
                }else if(num2 < num1 && num2 < num3){
                    
                    if(num1 < num3){
                        alert(num2 +","+num1 + ","+num3);
                    }else{
                        alert(num2 +","+num3 + ","+num1);
                    }
                    
                }else{
            
                    if(num1 < num2){
                        alert(num3 +","+num1 + ","+num2);
                    }else{
                        alert(num3 +","+num2 + ","+num1);
                    }
                    
                }
            </script>
        </head>
        <body>
            
        </body>
    </html>
    

    相关文章

      网友评论

          本文标题:练习3

          本文链接:https://www.haomeiwen.com/subject/xocscqtx.html