提交时间:2023-07-21 06:20:41
运行 ID: 23101
#include<iostream> #include<cstring> using namespace std; int main() { char s[25]; bool flag = true; gets(s); for(int i = 0; i < strlen(s); i++){ if(i == 0){ if(s[i] >= '0' && s[i] <= '9'){ flag = false; break; } } if((s[i]>='a' && s[i] <= 'z') || (s[i]>='A' && s[i] <= 'Z') || (s[i]>='0' && s[i] <= '9')){ continue; } else if(s[i] == '_'){ continue; } else{ flag = false; break; } } if(flag){ cout<<"yes"; } else cout<<"no"; return 0; }