提交时间:2021-06-19 16:42:08
运行 ID: 20643
#include<bits/stdc++.h> using namespace std; string s; int len; int main(){ cin>>s; len=s.length(); if((s[0]>='a'&&s[0]<='z')||(s[0]>='A'&&s[0]<='Z')||(s[0]=='_')){ for(int i=1;i<=len-1;i++){ if(!((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z')||(s[i]=='_')||(s[i]>='0'&&s[i]<='9'))){ cout<<"no"<<endl; return 0; } } }else{ cout<<"no"<<endl; return 0; } cout<<"yes"<<endl; return 0; }