importjava.util.Arrays;importjava.util.Random;publicclassVerificationCode{publicstaticvoidmain(String[]args){String[]CHARS={"3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","J","K","L","M","N","P","Q","R","S","T","U","V","W","X","Y"};boolean[]charFlags=newboolean[CHARS.length];String[]verifyCodes=newString[6];Randomran=newRandom();for(inti=0;iintindex; do{index=ran.nextInt(CHARS.length);}while(charFlags[index]);verifyCodes[i]=CHARS[index];charFlags[index]=true;}//这段代码求解释看不懂System.out.print("验证码为:");for(inti=0;iSystem.out.print(verifyCodes[i]); }}}
吃鸡游戏
相关分类