随机产生数字符串(可控制个数)
import java.util.Random;
import java.util.Scanner;
public class Demo6 {
public static void main(String[] args) {
Scanner input=new Scanner (System.in);
System.out.print("请输入会员姓名:");
String name=input.next();
System.out.print("请输入会员性别:");
String sex=input.next();
System.out.print("请输入会员年龄:");
String age=input.next();
System.out.println("创建会员成功");
System.out.print("会员编号是:");
Random a=new Random();
for (int i = 1; i<=4; i++) {
int num=a.nextInt(10);
System.out.print(num);
}
System.out.println("\n"+"会员详细信息:"+name+"\t"+sex+"\t"+age);
}
}