fork download
  1. import java.util.*;
  2.  
  3. class Main {
  4. public static void main (String[] args) {
  5. System.out.println(aleatoriar(1500, 5000));
  6. }
  7. public static int aleatoriar(int minimo, int maximo) {
  8. Random random = new Random();
  9. return random.nextInt((maximo - minimo) + 1) + minimo;
  10. }
  11. }
  12.  
  13. //https://pt.stackoverflow.com/q/54358/101
Success #stdin #stdout 0.06s 32520KB
stdin
Standard input is empty
stdout
4344