import java.util.Scanner;
public class AAA {
/**
* @param args
*/
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
boolean con;
do{
con=false;
System.out.print("请输入生日<月/日:00/00>:");
String date=input.next();
if(date.indexOf('/')!=2){
System.out.println("生日输入错误!");
}else{
System.out.print("该生日为"+date);
con=true;
}
}while(!con);
do{
con=false;
System.out.print("请输入密码<6~10位>:");
String pass=input.next();
if(pass.length()<6||pass.length()>10){
System.out.println("密码不符合输入要求");
}else{
System.out.print("密码是:"+pass);
con=true;
}
}while(!con);
}
}
第十五章课后第6题
最新推荐文章于 2024-06-17 14:50:48 发布