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.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int h = sc.nextInt();
for (int k = 0; k<h; k++){
String s1 = sc.nextLine();
int n = Code.display(s1);
if(n==1){
System.out.println("Yes");
}else{
System.out.println("No");
}
}
h++;
}
}
class Code {
public static int display(String password){
if(password.matches(".*[0-9]{1,}.*") && password.matches(".*[!@#$%&*]{1,}.*") && password.length()>=10 )
{
return 1;
}
else
{
return -1;
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run