1 #include<stdio.h> 2 #include<ctype.h> 3 #include<string.h> 4 const int MAXN = 1010 ; 5 int main() 6 { 7 int n ; 8 scanf("%d%*c",&n) ; 9 getchar() ; 10 char ch[MAXN] ; 11 for(int i = 1 ; i <= n ; i++) 12 { 13 gets(ch) ; 14 int flag = 1 ; 15 int len = strlen(ch) ; 16 if(ch[0] == '_'||isalpha(ch[0])) 17 { 18 for(int i = 1 ; i <= len-1 ; i++) 19 { 20 if((!isalpha(ch[i]))&&(!isdigit(ch[i]))&&(ch[i] != '_')) 21 { 22 flag = 0 ; 23 break ; 24 } 25 } 26 if(flag) 27 printf("Yes\n"); 28 else printf("No\n") ; 29 } 30 else 31 printf("No\n") ; 32 } 33 return 0 ; 34 }