提交时间:2024-11-01 15:52:24
运行 ID: 54978
#include<iostream> #include<cstring> using namespace std; char a[21]; int main() { cin>>a; bool flag=1; if('0'<=a[0]&&a[0]<='9'){ cout<<"no"; flag=0; } else{ for(int i=0;i<strlen(a);i++){ if(!(('A'<=a[i]&&a[i]<='z')||(a[i]=='_')||('0'<=a[i]&&a[i]<='9'))){ cout<<"no"; flag=0; break; } } } if(flag==1){ cout<<"yes"; } return 0; }