import java.util.*;
public class lianxi3 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String hao1, hao2, hao3;
boolean con;
do {
System.out.print("请输入身份证: ");
hao1 = input.next();
System.out.print("请输入手机号: ");
hao2 = input.next();
System.out.print("请输入座机号: ");
hao3 = input.next();
con = false;
String[] splithao3 = new String[3];
String zuoji[] = hao3.split("-");
if (hao1.length() != 16 && hao1.length() != 18) {
System.out.println("身份证号必须是16位或18位!");
} else if (hao2.length() != 11) {
System.out.println("手机号码必须是11位!");
} else if (zuoji[0].length() != 4 && zuoji[0].length() != 7) {
System.out.println("座机号码区号必须为4位,电话号码必须是7位");
} else {
System.out.println("注册成功!");
con = true;
}
} while (con);
}
}
15章实现会员注册升级
最新推荐文章于 2024-05-13 09:44:00 发布