提交时间:2025-12-05 15:47:50

运行 ID: 75339

#include <iostream> #include <cctype> using namespace std; bool isValidIdentifier(const string& str) { if (str.empty() || !isalpha(str[0])) return false; for (char ch : str) { if (!isalnum(ch) && ch != '_') return false; } return true; } int main() { string input; cin >> input; cout << (isValidIdentifier(input) ? "yes" : "no") << endl; return 0; }