Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
44304 | chenyanda | 合法C标识符 | C++ | 编译错误 | 0 MS | 0 KB | 332 | 2024-03-29 17:38:48 |
#include<iostream> #include<cstring> using namespace std; int main() { char s[20],cnt=0; cin>>s; for(int i=0;i<strlen(s)-1;i++){ if(s[i]>='A'&&s[i]<='Z'||s[i]>='a'&&s[i]<='z'){ cnt++; } } if(strlen(s)==cnt&&s[0]<'0'||strlen(s)==cnt&&s[0]>'9'||s[i]=='_'){ cout<<"yes"; } else{ cout<<"no"; } }