import java.util.*;
public class shang {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
System.out.println("欢迎进入注册系统");
boolean con=false;
do{int i=0;
System.out.println("输入身份证号:");
String shen=input.next();
System.out.println("输入手机号:");
String shou=input.next();
System.out.println("输入座机号:");
String zuo=input.next();
String[] s=new String[100];
s=zuo.split("-");
if(shen.length()==16||shen.length()==18){
i++;
}else{
System.out.println("身份证号必须是16 或者 18位数字");
} if(shou.length()==11){
i++;
}else{
System.out.println("手机号必须为11位数字");
}if(s[0].length()==4&&s[1].length()==7){
i++;
}else{
System.out.println("座机号码区位必须是4位,电话号码必须是7位");
}
if(i==3){
System.out.println("注册成功!");
break;
}
}while(true);
}
十五章 上机2 注册信息
最新推荐文章于 2021-12-19 15:38:23 发布