/*
* 以前写过这个
* */
import java.util.Scanner;
public class konwf {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
System.out.println(ff(str));
}
public static String ff(String str){//这就是你要的方法
if(str.length() < 8)
return "密码不合法";
int s = 0;
for(int i = 0;i<str.length();++i ){
if(Character.isLetterOrDigit(i))
return "密码不合法";
if(!Character.isDigit(str.charAt(i)))
s++;
}
if(s < 2)
return "密码不合法";
else
return"密码合法";
}
}
温馨提示:答案为网友推荐,仅供参考