<script> var level = prompt("请输入员工评级"); var salary = 5000; switch (level) { case "A": salary = salary + 500; console.log('哈哈哈' + salary); break; case "B": salary = salary + 200; console.log('不不不'); break; case "C": break; case "D": salary = salary - 200; break; case "E": salary = salary - 500; break; default: alert("请按套路出牌,输入A-E的值"); break; } console.log(salary); </script>