int digit = 0; //无数字
int eng = 0; //无英文
int islegal(string s){
digit = 0; //无数字
eng = 0; //无英文
for(int i = 0;i < s.length();++i){
if( isdigit(s[i]) ) digit = 1;
else if( isalpha(s[i]) ) eng = 1;
else if( s[i] == '.') continue;
else return 0; //其他非法字符,跳出
}
return 1;
}
int main()
{
//freopen("D:\\文件夹\\Desktop\\use.txt","r",stdin);
int n;scanf("%d",&n);getchar();
for(int i = 0;i < n;++i){
string s;
getline(cin,s);
if(i != 0) printf("\n");
if(s.length() < 6) {cout<<"Your password is tai duan le.";continue;}
if( !islegal(s) ) {cout<<"Your password is tai luan le.";continue;}
if(eng == 1 && digit == 0) {cout<<"Your password needs shu zi.";continue;}
if(eng == 0 && digit == 1) {cout<<"Your password needs zi mu.";continue;}
cout<<"Your password is wan mei.";
}
return 0;
}
谨记谨记,字符串的输入要getline,因为存在空格