Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
20863 | 季洁 | 合法 C 标识符 | C++ | 通过 | 100 | 0 MS | 256 KB | 331 | 2021-06-20 17:21:25 |
#include<bits/stdc++.h> using namespace std; int main(){ string x; cin>>x; if(x[0]>=48&&x[0]<=57){ cout<<"no"; return 0; } for(int i=0;i<=x.size()-1;i++){ if(((x[i]>=65&&x[i]<=90)||(x[i]>=97&&x[i]<=123)||x[i]=='_'||(x[i]>=48&&x[i]<=57))==0){ cout<<"no"; return 0; } } cout<<"yes"; return 0; }