提交时间:2026-01-04 15:04:15
运行 ID: 80155
#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; }