import javax.naming.PartialResultException;
import java.util.Scanner;
import java.util.Random;
public class RandomDemo {
public static void main(String[] args) {
char [] chars = zifu();
for (int i = 0; i < chars.length; i++) {
System.out.println(chars[i]);
}
}
public static char[] zifu(){
char [] chars = new char[62];
for (int i = 0; i < chars.length; i++) {
if (i<=25){
chars[i] = (char)('A'+i);}
else if (i<=51&&i>25){
chars[i] = (char)('a'+(i-26));}
else {chars[i]=(char) ('0'+i-52);
}
}
return chars;
}
}
关于产生26个英文字母大小写和0~9字符的程序。
于 2023-10-28 08:41:36 首次发布