
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
<script>
function ti(h,w,sex) {
var h=prompt("请输入您的身高")
var w=prompt("请输入您的体重")
var sex=prompt("请输入您的性别")
var h
var w
var sex
if (sex = "男") {
if (w < (h - 100)- 3) {
document.write("偏瘦")
} else if (w <= (h - 100) + 3) {
document.write("正常")
} else {
document.write("偏胖")
}
} else if(sex = "女") {
if (w < (h - 110)- 3) {
document.write("偏瘦")
} else if (w <= (h - 110) + 3) {
document.write("正常")
} else {
document.write("偏胖")
}
}
}
ti()
</script>
</html>