JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.regex.Pattern;
import java.util.regex.Matcher;
import java.util.Scanner;
public class Program{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String pass = sc.next();
String result = "";
if(pass.length() >= 7){
Pattern pNum = Pattern.compile("([0-9])(.*)([0-9])");
Matcher mNum = pNum.matcher(pass);
if(mNum.find()){
Pattern pChar = Pattern.compile("([!&#$%@*])(.*)([!&#$%@*])");
Matcher mChar = pChar.matcher(pass);
if(mChar.find())
result = "Strong";
else
result = "Weak";
}
else
result = "Weak";
}else{
result = "Weak";
}
System.out.print(result);
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run