-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP300.java
More file actions
32 lines (28 loc) · 881 Bytes
/
P300.java
File metadata and controls
32 lines (28 loc) · 881 Bytes
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
29
30
31
32
package p300_399;
import java.util.HashSet;
import java.util.Scanner;
//accepted
public class P300 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for (int i = 0; i < n; i++) {
String s = sc.next();
HashSet<Character> letras = new HashSet<>();
for (int j = 0; j < s.length(); j++) {
if (s.charAt(j) == 'a' ||
s.charAt(j) == 'e' ||
s.charAt(j) == 'i' ||
s.charAt(j) == 'o' ||
s.charAt(j) == 'u' ){
letras.add(s.charAt(j));
}
}
if (letras.size()== 5){
System.out.println("SI");
} else {
System.out.println("NO");
}
}
}
}