package arithmetic;

import java.util.Random;

public class Test04 {
		/**
		 * 密码的自动生成器:密码由大写字母/小写字母/数字组成,生成12位随机密码;
		 */
	
	public static void main(String[] args) {
			char [] pardStore = new char[62];
			for (int i = 0; i < 26; i++) {
				pardStore[i]=(char)('A'+i);
			}
			for (int i = 26; i < 52; i++) {
				pardStore[i]=(char)('a'+(i-26));
			}
			for (int i = 52; i < 62; i++) {
				pardStore[i]=(char)('0'+(i-52));
			}
			Random r = new Random();
			for (int i = 0; i < 12; i++) {
				int n = r.nextInt(62);
				System.out.print(pardStore[n]);
			}
			
	}
	
}

 

相关文章:

  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2021-12-05
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2021-10-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案