65,210
社区成员
发帖
与我相关
我的任务
分享#include<iostream>
using namespace std;
#include<string>
int main(){
int n;
cin>>n;
while(n--){
string s;
getline(cin,s);
for(string::size_type ix=0;ix!=s.size();ix++){
if(ix==0){
if(s[0]=='_'||isalpha(s[0]))
continue;
else
break;
}
if(isalnum(s[ix])||s[ix]=='_')
continue;
else
break;
}
if(ix==s.size())
cout<<"yes"<<endl;
else
cout<<"no"<<endl;
}
}