1081 检查密码 (15 分)

#include <bits/stdc++.h> 
using namespace std;
int main(){
    int n;
    cin>>n;
    getchar();
    for(int i=0;i<n;i++){
        string s;
        getline(cin,s);
        if(s.length()>=6){
            int a=0,b=0,c=0;
            for(int j=0;j<s.length();j++){
                if(s[j]!='.'&&!isalnum(s[j])){
                    a=1;
                }
                else if(isalpha(s[j])){
                    b=1;
                }
                else if(isdigit(s[j])){
                    c=1;
                }
            }
            if(a == 1)    cout<<"Your password is tai luan le."<<endl;
            else if(c == 0)    cout<<"Your password needs shu zi.
";
            else if(b == 0)    cout<<"Your password needs zi mu.
";
            else cout<<"Your password is wan mei.
";
        }
        else
            cout<<"Your password is tai duan le.
";
    }
    return 0;
}
原文地址:https://www.cnblogs.com/tonyyy/p/10470099.html