Math.random(); 需要注意的是,java中的隨機數是一個介於0到1的double型態浮點數。 ... int number = ((int)(Math.random()*1000) % (a-b)) + b; ...
確定! 回上一頁