<!DOCTYPE HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系好安全带,准备启航</title>
<script type="text/javascript">
//通过javascript的日期对象来得到当前的日期。
var mydate = new Date();
var y = mydate.getFullYear();
var m = mydate.getMonth()+1;
var d = mydate.getDate();
var w = mydate.getDay();
var week = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
//将题目中的字符串转化为带有规律的数组
var scoreStr = "小明:87;小花:81;小红:97;小天:76;小张:74;小小:94;小西:90;小伍:76;小迪:64;小曼:76";
var myarr = scoreStr.split(";").join(":").split(":");
//将数组里的数值相加求和
var sum = 0;
for(var i=1;i<myarr.length;i+=2){
sum = sum + parseInt(myarr[i]);
}
//输出结果
document.write(y + "年" + m + "月" + d + "日" + " " + week[w] + "--" + "班级总分为:" + sum);
</script>
</head>
<body>
</body>
</html>