Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
23101 LeoWang 合法C标识符 C++ 通过 0 MS 252 KB 526 2023-07-21 06:20:41

Tests(3/3):


#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; }


测评信息: