'use strict';
var height = parseFloat(prompt('请输入身高(m):')); var weight = parseFloat(prompt('请输入体重(kg):'));
var ibm = height/Math.pow(weight , 2); if (ibm<18.5){ alert('过轻'); } else if(ibm<25){ alert('正常'); } else if(ibm<28){ alert('过重'); } else if(ibm<32){ alert('肥胖'); } else { alert('严重肥胖'); }
Sign in to make a reply
你tm逗我真伟大
'use strict';
var height = parseFloat(prompt('请输入身高(m):')); var weight = parseFloat(prompt('请输入体重(kg):'));
var ibm = height/Math.pow(weight , 2); if (ibm<18.5){ alert('过轻'); } else if(ibm<25){ alert('正常'); } else if(ibm<28){ alert('过重'); } else if(ibm<32){ alert('肥胖'); } else { alert('严重肥胖'); }