Expresar mejor valor rand

This commit is contained in:
PC de clase committed 2026-10-26 09:50:07 +01:00
1 parent 96e2bed803
commit bfbbfec86d
1 file changed
+1 -1
+1 -1
View File
@@ -3,7 +3,7 @@ import java.util.Random;
public class GeneradorContraseñas {
public static void main(String[] args){
Random r = new Random();
int len = r.nextInt(13-8) + 8; // 8-12
int len = r.nextInt(12 + 1 - 8) + 8; // 8-12
for(int i = 0; i < len; i++) {
switch (r.nextInt(3)) {
case 0: // Dígito