苦逼程序猿,没事意淫下,想想啥时候能迎娶白富美,出任CEO,走上人生巅峰啊,万一实现了呢【/捂脸】
function showMoney(basemoney,increase,years){
var amountMoney=0;
for(var i=1;i<years+1;i++){
console.log("第"+i+"年的工资"+basemoney+"元");
basemoney+=basemoney*increase;
amountMoney+=basemoney*12;
console.log("第"+i+"年的总工资"+basemoney*12+"元");
}
console.log("这是你"+years+"年总共的工资为"+amountMoney+"元");
return amountMoney;
}
function useMoney(basemoney,increase,years){
var amountMoney=0;
for(var i=1;i<years+1;i++){
console.log("第"+i+"每个月的花费"+basemoney+"元");
basemoney+=basemoney*increase;
amountMoney+=basemoney*12;
console.log("从工作到第"+i+"年总共花费"+basemoney*12+"元");
}
console.log("这是你"+years+"年总共的开销为"+amountMoney+"元");
return amountMoney;
}