import java.util.Random;
public class Homework0511 {
public static void main(String[] args) {
Random rand=new Random(); String str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; System.out.print("验证码是(区分大小写):"); for(int i=0;i<4;i++) { int p=rand.nextInt(61); System.out.print(str.substring(p, p+1)+" "); } }}
运行结果:
时间: 2024-10-07 10:56:25