0
已解决
王子耀
缔造者
缔造者
代码:
#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main(){
string a;
getline(cin,a);
for(int i=0;i<=a.size()-1;i++){
if(i==0){
if(a[i]>=65&&a[i]<=90){
continue;
}
if(a[i]>=97&&a[i]<=122){
cout<<"No";
break;
}
if(a[i]>=48&&a[i]<=57){
cout<<"Mo";
break;
}
else{
continue;
}
}
if(i!=0&&i!=a.size()-1){
if(a[i]>=48&&a[i]<=57){
continue;
}
if(a[i]>=65&&a[i]<=90){
continue;
}
if(a[i]>=97&&a[i]<=122){
continue;
}
if(a[i]=='_'){
continue;
}
else{
cout<<"No";
break;
}
}
if(i==a.size()-1){
if(a[i]>=48&&a[i]<=57){
cout<<"Yes";
}
if(a[i]>=65&&a[i]<=90){
cout<<"Yes";
}
if(a[i]>=97&&a[i]<=122){
cout<<"Yes";
}
if(a[i]=='_'){
cout<<"Yes";
}
else{
cout<<"No";
}
}
}
}
可以复制