js运算

今天把五个题目都做出来了,虽然可能用的方法比较麻烦。不过总体来说不错:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
</body>
</html>
<script>
x=prompt("请输入x","")
y=prompt("请输入y","")
z=prompt("请输入z","")
if(x>y&&x>z){
if(y>z){
alert(x+y+z+"")
}
else{
alert(x+z+y+"")
}
}
else{
if(y>x&&y>z){
if(x>z){
alert(y+x+z+"")
}
else{
alert(y+z+x+"")
}
}
else{
if(z>x&&z>y){
if(x>y){
alert(z+x+y+"")
}
else{
alert(z+y+x+"")
}
}
}
}
</script>

posted @ 2017-07-21 21:54  傻糊糊  阅读(197)  评论(0编辑  收藏  举报