<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
</body>
<script type="text/javascript">
var consume = Number(prompt("请输入用电量"));
var money;
if(consume <= 150){
money = consume*0.4463;
}else if(consume<=400){
money = 150*0.4463+(consume-150)*0.4663;
}else{
//400-150=250 第二梯度 0.4663
money=150*0.4463+250*0.4663 +(consume-400)*0.5663;
}
money = money.toFixed(2);
alert(money);
</script>
</html>