<html>
<head>
<title></title>
<meta charset="utf-8">
<script type="text/javascript">
windowonload=function(){
var oP=documentgetElementsByTagName('p')[0];
var Now=null;
var New=null;
var t=null;
var str=null;
timer();
setInterval(function(){
timer();
},1000)
function timer(){
Now=new Date();
New=new Date(2019,0,1,0,0,0);
t=Mathfloor((New-Now)/1000);
str='还剩下'+Mathfloor(t/86400)+'天'+Mathfloor(t%86400/3600)+'时'+Mathfloor(t%86400%3600/60)+'分'+t%60+'秒';
oPinnerHTML=str;
}
}
</script>
</head>
<body>
<p></p>
</body>
</html>var distance = 700;
if(distance < 1000)
consolelog(distance+"米");
else if(distance > 1000)
consolelog((Mathround(distance/100)/10)toFixed(1) + "公里")/ 求两点距离 / public static getDistance(x1: number, y1: number, x2: number, y2: number) { var _x: number = Mathabs(x1 - x2); var _y: number = Mathabs(y1 - y2); return Mathsqrt(_x _x + _y _y); }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)