Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
58075 | littletwleve | 合法C标识符 | C++ | Accepted | 1 MS | 248 KB | 382 | 2024-12-03 18:34:02 |
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; bool flag=true; for(int i=0;s[i]!='\0';i++){ if(s[0]>='0'&&s[0]<='9'){ flag=false; break; } if(s[i]>='a'&&s[i]<='z'||s[i]>='A'&&s[i]<='Z'||s[i]>='0'&&s[i]<='9'||s[i]=='_'){ continue; }else{ flag=false; } } if(flag) cout<<"yes"; else cout<<"no"; return 0; }