Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
37345 | ☩Deutschland☩ | 合法C标识符 | C++ | Accepted | 0 MS | 256 KB | 339 | 2024-01-20 11:21:21 |
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; if(s[0]>='0'&&s[0]<='9'){ cout<<"no"; return 0; } for(int i=0;i<s.length();i++){ if(!((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z')||(s[i]>='0'&&s[i]<='9')||(s[i]=='_'))){ cout<<"no"; return 0; } } cout<<"yes"; return 0; }