<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>while语句算法</title>
</head>
<body>
<script>
var mony=1000,year=0;
while(mony<=2000){
mony=mony+mony*0.05;
year++;
document.write(mony+'<br/>');
}
document.write(year);
</script>
</body>
</html>
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星