日期:2014-05-16 浏览次数:21244 次
<script language="javascript" runat="server">
var random = function(min, max){
return Math.floor(Math.random() * (max - min + 1) + min);
};
var fn = function(){
var x, g = random(1, 100);
if( g == 100 ){
x = 20
}else if( g == 99
------解决方案--------------------
g == 98 ){
x = 19
}else if( g < 81 ){
x = 5;
}else{
x = [random(1,4), random(6, 18)][random(0, 1)];
}
return x;
};
</script>
<%
= fn()
%>