Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
40641 | chenyifei | 合法C标识符 | C++ | Wrong Answer | 1 MS | 248 KB | 426 | 2024-02-15 11:33:33 |
#include<iostream> #include<cstring> using namespace std; int main() { char a[25]; cin>>a; for(int i=0;i<strlen(a);i++){ if(a[0]>='0'&&a[0]<='9'){ cout<<"no"; break; } for(int j=1;j<strlen(a);j++){ if((a[j]>='0'&&a[j]<='9')||(a[j]>='a'&&a[j]<='z')||(a[j]>='A'&&a[j]<='Z')||a[j]=='_'){ continue; } else{ cout<<"no"; break; } cout<<"yes"; } } return 0; }