var money = (parseInt(prompt("请输入本金:")*1)); var year = (parseInt(prompt("请输入存款期限:")*1)); var lixi; if(year ==1){ lixi = money*0.0063*12*year; }else if(year ==2){ lixi = money*0.0066*12*year; }else if(year == 3) { lixi = money*0.0069*12*year; }else if(year == 5) { lixi = money*0.0075*12*year; }else if(year == 8) { lixi = money*0.0084*12*year; }else{ alert('出错了') } alert("本息和是"+(money+lixi));