第2个回答 2019-09-08
想用枚举存放关键字用来判断,失败了。
#include
<stdio.h>
//
enum
keywd{enum,auto,double,int,struct,break,else,long,switch,case,register,typedef,
//
char,extern,return,union,const,float,short,unsigned,continue,
for
,signed
,void
,default,
//
goto,
sizeof
,volatile,
do,
if,
while,
static
};
void
main()
{
char
str[100];
gets(str);
if((str[0]=='_')||(str[0]>='A'&&str[0]<='z'))
printf("yes\n");
else
printf("no\n");
}