Problem Description
Enter a string to determine whether it is a valid identifier for C.
Input
The input data contains multiple test instances, and the first row of the data is an integer n, representing the number of test instances, followed by n rows of input data, each of which is a string of no more than 50 length.
Output
For each set of input data, output one line. If the input data is a valid identifier for C, output "yes", otherwise, output "no".
Sample Input
3
12ajf
Fi8x_a
FF Ai_2
Sample Output
No
Yes
No
1#include <stdio.h>2#include <ctype.h>3 4 intMain () {5 intN;6 CharC;7 inti;8 intFlag;9 Tenscanf"%d",&n); One GetChar (); A - while(n--){ -I=0; theflag=0; - while((C=getchar ())! ='\ n'){ - if(i==0){ - if(c=='_'|| Isalpha (c)! =0) + ; - + Else Aflag=1; at } - - Else{ - if(c=='_'|| Isalpha (c)! =0|| IsDigit (c)! =0) - ; - in Else -flag=1; to } + -i++; the } * $ if(flag==0)Panax Notoginsengprintf"yes\n"); - the Else +printf"no\n"); A } the + return 0; -}
C-Language legal identifiers