var a=weight/height/height if(a<18.5) { alert("过轻"); } if(a>18.5&&a<25) { alert("正常"); } if(a>25&&a<28) { alert("过重"); } if(a>28.5&&a<32) { alert("肥胖"); } if(a>32) { alert("严重肥胖"); }
不用一下else if吗?
这代码格式看醉了
Sign in to make a reply
Dicetequiero
var a=weight/height/height if(a<18.5) { alert("过轻"); } if(a>18.5&&a<25) { alert("正常"); } if(a>25&&a<28) { alert("过重"); } if(a>28.5&&a<32) { alert("肥胖"); } if(a>32) { alert("严重肥胖"); }