#include <stdio.h>
#include <string.h>
static const char *Keyword[32]=
{
"auto", "break", "case", "char",
"const", "continue","default", "do",
"double", "else", "enum", "extern",
"float", "for", "goto", "if",
"int", "long", "register", "return",
"short", "signed", "static", "sizeof",
"struct", "switch", "typedef", "union",
"unsigned","void", "volatile", "while"
};
int IsKeyword(const char *s)
{
int i;
for(i=0;i<32;i++) if(!strcmp(s,Keyword[i])) return 1;
return 0;
}
int IsIdentifier(const char *s)
{
if(IsKeyword(s)) return 0;
if(!isalpha(*s) && *s != '_') return 0;
s++;
while(*s)
{
if(!isalpha(*s) && !isdigit(*s) && *s != '_') return 0;
s++;
}
return 1;
}
int main(void)
{
char str[125];
gets(str);
if(IsIdentifier(str)) printf("it is a indentifier string");
else printf("it is not a indentifier string");
getch();
return 0;
}