Discuss / JavaScript / 作业,,,很简单的写的。。。

作业,,,很简单的写的。。。

Topic source

Dicetequiero

#1 Created at ... [Delete] [Delete and Lock User]

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("严重肥胖"); }

champkeh

#2 Created at ... [Delete] [Delete and Lock User]

不用一下else if吗?

这代码格式看醉了


  • 1

Reply