怎么用js写个100数字以内的随机除法题目

怎么用js写个100数字以内的随机除法题目,要求就是题目能整除,像25/5=,36/2=这样,不要生成67/2=,14/66=这种题目,有没有什么方法啊

1.随机一个被除数(如果你需要提出质数,可以剔除);
2.根据随机出来的被除数找出其因数,然后从因数随机选择(可以剔除1和本身,如果存在质数,那么剔除1和本身就不会再有可整除的数了);

希望这个思路能够帮到你....

 var x = 1000;
var y = 1000;
while (x * y < 100)
{
x = Math.floor(Math.random()*100+1);
y = Math.floor(Math.random()*100+1);
}
alert(x * y + "/" + x + "=?");

x = Math.floor(Math.random()*100+1);
y = Math.floor(Math.random()*100+1);
->
x = Math.floor(Math.random()*10+1);
y = Math.floor(Math.random()*10+1);

如果要出100题,外面加上for (var i = 1; i < 100; i++)


    var x, y,max=100;
    do {
        x = Math.floor(max * Math.random());
        y = Math.floor(max * Math.random());
    }
    while (x % y != 0);
    document.write(x+'/'+y+'='+(x/y))

这个是我用java写的,可以改成js的,100以内能除进的所有题目,可以随机选择100道:
for(int x = 2; x <100; x++){
for(int y = x; y < 100; y++){
if(x * y < 100){
System.out.println((x * y) + "÷" + x + "=");
}
}
}