let number1, operator, number2;
let validNumber = false;
if(weishu==2)
{
number1 = Math.floor(Math.random() * 90) + 10;
}
if(timushuzi==0)
{
number2 = Math.floor(Math.random() * 8) + 2;
}
else
{
number2 = timushuzi;
}
if(type==1000)//乘法
{
operator = '*';
result = number1 * number2;
}
else
{
operator = '/';
// 循环直到找到一个合适的数字
do {
//这里怎么写才能让除法结果都是整数
} while (!validNumber);
result = number1 / number2;
}
question = `${number1} ${operator} ${number2}`;
if(operator=='*')
{
fhao='×';
}
else
{
fhao='÷';
}
question1 = `${number1} ${fhao} ${number2}`;
setTimeout(() => {
displayQuestion(question1, '', '=');
}, shijian*1000);
do {//这里怎么写才能让除法结果都是整数} while (!validNumber);