Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
75339 sh25_wangtaojie 合法C标识符 C++ 通过 0 MS 248 KB 412 2025-12-05 15:47:50

Tests(3/3):


#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; }


测评信息: