这个可以ab
var week=["星期天","星期一","星期二","星期三","星期四","星期五","星期六",]
var time=new Date();
var year=time.getFullYear();
var month=time.getMonth()+1;
var date=time.getDate();
var day=time.getDay();
var scoreStr = "小明:87;小花:81;小红:97;小天:76;小张:74;小小:94;小西:90;小伍:76;小迪:64;小曼:76";
var arr=scoreStr.split(";");
var arr1=arr.join(":");
var arr2=arr1.split(":");
var scor,sum=0;
for(var i=1;i<arr2.length;i=i+2)
{
sum=sum+parseInt(arr2[i]);
}
alert(arr2.length);
scor=parseInt(sum/arr2.length*2);
document.write(year+"年"+month+"月"+date+"日"+" "+week[day]+" 平均分:"+scor);
。