C - Pashmak and Buses Codeforces Round #261 (Div. 2) C. Pashmak and Buses time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Recently Pashmak has been employed in a transportation company. The
1.根据时间生成m位随机数,最大13位随机数,并且不能保证首位不为0. 例子: function ran(m) { m = m > 13 ? 13 : m; var num = new Date().getTime(); return num.toString().substring(13 - m); } console.log(ran(5)); 2.根据Math的random函数生成的随机数截取m位,生成随机数最大不超过16位,能保证首位不为0. 例子 function rand(m) { m
$(function () { /*生成32位随机流水号*/ /*默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1*/ var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; var maxPos = $chars.length; var pwd = ''; for (i = 0; i < 32; i++) { pwd += $chars.charAt(Math.floor(Math.random() * max
function sj() { //x上限,y下限 var x = 2000; var y = 1800; var rand = parseInt(Math.random() * (x - y + 1) + y); console.log(rand); } $('#date').click(function() { sj(); });