Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
37299 | zhouhuanyu 玙静 | 合法C标识符 | C++ | Accepted | 0 MS | 252 KB | 380 | 2024-01-20 09:27:22 |
#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; }