当然,如果你够厉害型悉,直接将压缩包睁裤当成二进制或者文本来读取,从中找到数字密码对应的字符串,然后处理加解析即可。
已完成,复制粘贴即可。import java.util.Scanner
public class YuGiOh
{
private static void checkPass ( String password )
{
String regp = ".*[A-Z].*"
String rego 做正御= ".*[a-z].*"
String regq = ".*\\d.*"
String regs = ".*[\\`\\-\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\_\\+\\=\\[\\{\\}\\]\\\\:\\,\\.\\<\\>纯岩\\/\\?].*"
String regex = "^[a-zA-Z\\d\\`\\-\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\_\\+\\=\\[\\{\\}\\]\\\\:\\,\\.\\<\\>\\/\\?]{6,}$"
String result = ""
if (password.length () < 6)
{
result += "\t\t-contain at least 清郑six characters. Your password is only " + password.length () + " characters long.\n"
}
if (!password.matches (regp))
{
result += "\t\t-contain at least one uppercase letter.\n"
}
if (!password.matches (rego))
{
result += "\t\t-contain at least one lowercase letter.\n"
}
if (!password.matches (regq))
{
result += "\t\t-contain at least one number.\n"
}
if (!password.matches (regs))
{
result += "\t\t-contain at least one of the following special characters: `!@#$%^&*()_+=[{}]:,.<>/?\n"
}
else if (!password.matches (regex))
{
result += "\t\t-not contain an invalid character. The valid special characters: `!@#$%^&*()_+=[{}]:,.<>/?\n"
}
if (!"".equals (result))
{
System.out.println ("Your password must:\n" + result)
}
else
{
System.out.println ("Your valid password is: " + password)
}
System.out.println ()
}
public static void main ( String[] args )
{
Scanner scanner = new Scanner (System.in)
while (true)
{
System.out.print ("Enter a valid password: ")
String password = scanner.nextLine ()
checkPass (password)
}
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)