Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
107404 | 何嘉欢 | 合法的标识符 | C++ | Wrong Answer | 1 MS | 272 KB | 384 | 2025-01-17 16:27:12 |
#include<bits/stdc++.h> using namespace std; string s; int main(){ cin>>s; int a=1; for(int i=0;i<s.size();i++){ if(s[0]>='0'&&s[0]<='9'){ a=0; cout<<"no"; break; } if(s[i]>='a'&&s[i]<='z'||s[i]=='_'||s[i]>='A'&&s[i]<='Z'){ a=1; } if(i>=1){ if(s[i]>='0'&&s[i]<='9'){ a=1; } } } if(a==1){ cout<<"yes"; } return 0; }
------Input------
a_b!d
------Answer-----
no
------Your output-----
yes