package sss;
import java.util.Scanner;
public class jjj {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
boolean com = false;
do {
System.out.println("输入身份证号码:");
String s = input.next();
System.out.println("输入手机号:");
String j = input.next();
System.out.println("输入座机号:");
String q = input.next();
String[] w = q.split("-");
for (int i = 0; i < w.length; i++) {
System.out.println(w[i]);
}
if (w[0].length() != 4 && w[1].length() != 7) {
System.out.println("座机号码区号必须为4位,电话号码必须是7位!");
} else if (s.length() != 16 && s.length() != 18) {
System.out.println("身份证号码必须是16位或18位!");
} else if (j.length() == 11) {
System.out.println("手机号必须是11位");
} else {
System.out.println("注册成功");
com = true;
break;
}
} while (com);
}
}
实现会员注册升级
最新推荐文章于 2024-05-13 09:44:00 发布