import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int n = sc.nextInt();
sc.nextLine();
while (n-- != 0) {
char[] str = sc.nextLine().toCharArray();
boolean t = true;
if (str[0] == '_' || 'a' <= str[0] && str[0] <= 'z' || 'A' <= str[0] && str[0] <= 'Z') {
for (int i = 1; i < str.length; i++) {
if (!(str[i] == '_' || 'a' <= str[i] && str[i] <= 'z' || 'A' <= str[i] && str[i] <= 'Z' || '0' <= str[i] && str[i] <= '9')) {
t = false;
break;
}
}
} else {
t = false;
}
if (t) {
System.out.println("yes");
} else {
System.out.println("no");
}
}
}
}
}
杭电 2024 ( C语言合法标识符 ) java
最新推荐文章于 2020-01-30 20:01:07 发布