Run ID:100494
提交时间:2024-12-08 10:23:54
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; bool flag = true; //默认满足条件 if(s[0]>='0' && s[0]<='9'){ flag = false; //数字字符开头,不满足条件 } else{ for(int i=0;i<s.size();i++){ if(!(s[i]>='a' && s[i]<='z' || s[i]>='A' && s[i]<='Z' || s[i]>='0' && s[i]<='9' ||s[i]=='_')){ flag = false; } } } if(flag){ cout<<"yes"; } else{ cout<<"no"; } return 0; }