杭电 hdu 2024
2013-07-25 18:58
190 查看
C语言合法标识符:
本文出自 “菜鸟的进阶之路” 博客,请务必保留此出处http://beyond316.blog.51cto.com/7367775/1257411
#include<iostream> #include<string.h> #include<stdio.h> using namespace std; #define N 1000 char str ; int main(){ int n; cin>>n; cin.ignore(); while(n--){ gets(str); int len=strlen(str); int t=0; if((str[0]<='z'&&str[0]>='a')||(str[0]<='Z'&&str[0]>='A')|| str[0]=='_'){ int i; for(i=1;i<len;++i){ if((str[i]<='z'&&str[i]>='a')||(str[i]<='Z'&&str[i]>='A')|| (str[i]<='9'&&str[i]>='0')||str[i]=='_') continue; else{ cout<<"no"<<endl; t=1; break; } } } else{ t=1; cout<<"no"<<endl; } if(t==0) cout<<"yes"<<endl; } return 0; }
本文出自 “菜鸟的进阶之路” 博客,请务必保留此出处http://beyond316.blog.51cto.com/7367775/1257411
相关文章推荐
- hdu(杭电)ACM 1232 畅通工程
- Hdu 2500 做一个正气的杭电人
- HDU--杭电--2602--Bone Collector--背包
- 杭电2110-Crisis of HDU
- 【HDU 杭电 2059 龟兔赛跑】
- 杭电hdu 1213 How Many Tables并查集
- 杭电(hdu)2098 分拆素数和
- 杭电hdu 1166 敌兵布阵 线段树
- 杭电(hdu)ACM 1166 敌兵布阵
- JAVA(HDU)杭电ACM 2955
- hdu---1290献给杭电五十周年校庆的礼物
- 杭电 hdu 1003
- 杭电(hdu)2070 Fibbonacci Number 水题
- 【 HDU 杭电 1950 Bridging signals】
- HDU_4911_Inversion_归并统计逆序对_杭电多校A题
- 杭电acm2091 hdu-acm-2091空心三角形解题报告
- 【HDU 杭电 1513 Palindrome 】
- 杭电hdu 1237 简单计算器 stack
- 杭电hdu 1861 游船出租 简单题
- 【二分图+最小覆盖+简单题】杭电 hdu 1054 Strategic Game