import java.util.Random;
public class Test02 {
public static void main(String[] args) {
System.out.println(getStr());
}
public static String getStr(){
Random r=new Random();
int a= r.nextInt(10)+48;
int b=r.nextInt(5);
char[] ch=new char[5];
for (int i = 0; i < 5; i++) {
int c=r.nextInt(26)+65;
char d=(char)c;
if(i==b){ch[i]=(char)a;
}
else{ch[i]=d;
}}
String str="";
for (int i1 = 0; i1 < ch.length; i1++) {
str=ch[i1]+str;
}
return str;}
}
|
|