简单的密码生成器
Random myrand = new Random();
int x = myrand.nextInt(126);
x = x+1;
char c = (char)x;
//this gets the character version of x
for (int mycounter = 0; mycounter < 10; mycounter++)
{
x = myrand.nextInt(127);
x = x+1;
if (x == 32)
{
x = 33;
}
c = (char)x;
System.out.print(c);
}
System.out.println();
我的错误在哪里?
我该如何解决?