sds
2015-03-21
阅读 1 分钟
1.8kfunction validate(num){var s1=0,s2=0,rear=num.toString().split("").reverse(),evar=[];for(var i=rear.length-1;i>=0;i--){if(i%2==0){s1+=(+rear[i])}else{evar.push(rear[i]*2)}}for(var k=evar.length-1;k>=0;k--){s2+=(evar[k]<10?evar[k]:(evar[k]-9))}if((s1+s2)<10){return false}else{return(s1...