求助

B3843 [GESP202306 三级] 密码合规

GreenMelon @ 2024-07-19 16:29:28

样例全过

#include <bits/stdc++.h>
using namespace std;
string s, mima[105];
int tot;
int main(){
    cin>>s;
    for(int i=0;i<s.size();i++){
        if(s[i]==','){
            tot++;
            continue;
        }
        mima[tot]+=s[i];
    }
    for(int i=0;i<=tot;i++){
        bool is=false;
        int da=0, xiao=0, shu=0, teshu=0;
        for(int j=0;j<mima[i].size();j++){
            char c=mima[i][j];
            if(c>='a' && c<='z') {xiao++; continue;}
            if(c>='A' && c<='Z') {da++; continue;}
            if(c>='0' && c<='9') {shu++; continue;}
            if(c=='!') {teshu++; continue;}
            if(c=='@') {teshu++; continue;}
            if(c=='#') {teshu++; continue;}
            if(c=='$') {teshu++; continue;}
            is=true;
        }
        if(mima[i].size()>=12 || mima[i].size()<=6) is=true;
        if(!is && ((da && xiao) || (xiao && shu) || (shu && da)) && teshu>=1) cout<<mima[i]<<endl;
    }
    return 0;
}

by RainCQwQ @ 2024-07-19 16:43:48

目前已知你代码问题:

@GreenMelon


by GreenMelon @ 2024-07-19 16:47:24

@RainCQwQ AC了,谢谢


|