Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
80155 sh25_zhuwy 合法C标识符 C++ 通过 0 MS 248 KB 408 2026-01-04 15:04:15

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


测评信息: