//首先特判掉第一个为数字的
//然后从第一个(a1)开始判断,锁定串长遍历,如果出现就Break,如果没有则继续。
//strcmp()函数。
#include<stdio.h>
#include<string.h>
char a[34][10]={"auto","break","case","char","const","continue","default","do","double","else","enum",
"extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static",
"struct","switch","typedef","union","unsigned","void","volatile","while"} ;
char num[34];
int main()
{int k;scanf("%d",&k);while(k--){int flag=1;scanf("%s",num);int n=strlen(num);for(int i=0;i<n;i++){if(num[0]>='0'&&num[0]<='9'){flag=0;break;}if(num[i]>='0'&&num[i]<='9'||num[i]>='a'&&num[i]<='z'||num[i]>='A'&&num[i]<='Z'||num[i]=='_'){continue;}else{flag=0;break;}}if(flag){if(n>=2&&n<=8){for(int i=0;i<32;i++){if(strcmp(num,a[i])==0){flag=0;break;}else continue;}}}if(flag==0) printf("No\n");else printf("Yes\n");}return 0;
}
详细解决方案
XTU OJ 1234 Legal Identifier
热度:71 发布时间:2023-12-04 21:32:19.0
相关解决方案
- No row with the given identifier exists解决方案
- 遇到的最为奇怪的有关问题:“type”并不包含“identifier”的定义
- OpenFileMapping提醒error C3861: 'OpenFileMapping' identifier not found
- CCS编译X264 ERROR string.h error:identifier "using" is undefined,该如何处理
- -Bad line 52 in /etc/environment ' not a valid identifier-解决方案
- -Bad line 52 in /etc/environment ' not a valid identifier-解决方法
- -Bad line 52 in /etc/environment ': not a valid identifier-该怎么处理
- FireFox Flash<embed src="ch.swf" FlashVars="uid=1234" 不支持解决思路
- No row with the given identifier exists问题,求解
- freemarker中 The only legal comparisons are between two . 有关问题解决
- FireFox Flash<embed src="ch.swf" FlashVars="uid=1234" 不支持解决办法
- FireFox Flash<embed src="ch.swf" FlashVars="uid=1234" 不支持解决思路
- No row with the given identifier exist有关问题
- freemarker中 The only legal comparisons are between two . 问题解决
- ORA-00904: "ENREMPINFO7_""FSTUDENT_CODE" invalid identifier
- 表关联修改外键错误:identifier of an instance of Object was altered from 1 to 7
- The given object has a null identifier: entity.Teacher有关问题
- a different object with the same identifier value was already associated with the session
- JBPM3 No row with the given identifier exists,该如何处理
- 求教程序连接揭示ORA-12154: TNS:could not resolve the connect identifier specified
- ORA-12154: TNS:could not resolve the connect identifier specified解决方案
- Error - ORA-12154: TNS:could not resolve the connect identifier specified,该如何解决
- oracle11g+win7:ORA-12154: TNS:could not resolve the connect identifier specified解决办法
- ORA-12154: TNS:could not resolve the connect identifier specified
- .ORA-12154: TNS:could not resolve the connect identifier specified~搞了好久了没解决
- 呼救.ORA-12154: TNS:could not resolve the connect identifier specified~搞了好久了没解决
- 将String类型的数字格式化成逗点加小数点形式如“1234”变成"1,234.00"解决方法
- expected identifier or "("该怎么解决
- OpenFileMapping提示error C3861: 'OpenFileMapping': identifier not found解决办法
- No resource identifier found for attribute 'parentActivityName' in package 'android'