<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html:charset=gb2312" />
<title>梦之都</title>
</head>
<body>
<h3>这段代码有意思</h3>
<p>看下自己可以挣多少钱</P>
<script type="text/javascript">
//iPay -- 初始工资
//iInCompany -- 进入公司年龄
//iOutCompany -- 退休年龄
//iUpPercent -- 涨工资的比例
//iSumPay -- 总工资
var iPay = 3500;
var iInCompany = 27;
var iOutCompany = 60;
var iCount = iOutCompany-iInCompany;
var iUpPercent = 0.1;
var iSumPay = 0;
document.write("你"+iInCompany+"岁开始定存,每个月定存"+iPay+",每年增加"+iUpPercent*100+"%!<br />");
for(var i=1;i<iCount;i++)
{
iSumPay+=(iPay*12);
document.write("第"+i+"年每月你赚:" + Math.round(iPay) + ";累计为:"+ Math.round(iSumPay)+"人民币<br />");
iPay*=(1+iUpPercent);
}
document.write("看好了!你快退休时每月赚多少钱:" + Math.round(iPay) + "人民币,你在这个神奇的公司总共赚了:"+ Math.round(iSumPay) +"人民币<br />");
</script>
</body>
</html>
<html>
<head>
<meta http-equiv="content-type" content="text/html:charset=gb2312" />
<title>梦之都</title>
</head>
<body>
<h3>这段代码有意思</h3>
<p>看下自己可以挣多少钱</P>
<script type="text/javascript">
//iPay -- 初始工资
//iInCompany -- 进入公司年龄
//iOutCompany -- 退休年龄
//iUpPercent -- 涨工资的比例
//iSumPay -- 总工资
var iPay = 3500;
var iInCompany = 27;
var iOutCompany = 60;
var iCount = iOutCompany-iInCompany;
var iUpPercent = 0.1;
var iSumPay = 0;
document.write("你"+iInCompany+"岁开始定存,每个月定存"+iPay+",每年增加"+iUpPercent*100+"%!<br />");
for(var i=1;i<iCount;i++)
{
iSumPay+=(iPay*12);
document.write("第"+i+"年每月你赚:" + Math.round(iPay) + ";累计为:"+ Math.round(iSumPay)+"人民币<br />");
iPay*=(1+iUpPercent);
}
document.write("看好了!你快退休时每月赚多少钱:" + Math.round(iPay) + "人民币,你在这个神奇的公司总共赚了:"+ Math.round(iSumPay) +"人民币<br />");
</script>
</body>
</html>