modify code

master
algorithmzuo 3 years ago
parent e50de1cee5
commit f647a2f12d

@ -110,7 +110,7 @@ public class Code03_KM {
// [-range, +range]
public static int randomNumber(int range) {
return ((int) (Math.random() * range) + 1) - ((int) (Math.random() * range) + 1);
return (int) (Math.random() * (range + 1)) - (int) (Math.random() * (range + 1));
}
public static void main(String[] args) {

Loading…
Cancel
Save