0分?大佬们帮我康康

B3843 [GESP202306 三级] 密码合规

lab1224 @ 2024-06-27 22:33:31

#include <bits/stdc++.h>
using namespace std;
string a;
string s;
int main(){
    cin >> a;
    int pos = 0;
    int dx = 0,xx = 0,sz = 0,zf = 0;
    for(int i = 0;i <= a.length();i++){
        if((a[i] == ',')||(i == a.length())){
            s = a.substr(pos,i-pos);
            if(s.length() < 6 || s.length() > 12){
                continue;
            }
            for(int j = 0;j < s.length();j++){
                if(s[j] - '0' <= 10 && s[j] - '0' >= 1){
                    sz++;
                }else if(s[j] <= 'z' && s[j] >= 'a'){
                    xx++;
                }else if(s[j] <= 'Z' && s[j] >= 'A'){
                    dx++;
                }else if(s[j] == '!' || s[j] == '@' || s[j] == '#' || s[j] == '$'){
                    zf++;
                }
            }
            if((zf >= 1) && ((dx >= 1 && xx >= 1) || (dx >= 1 && sz >= 1) || (xx >= 1 && sz >= 1) || (dx >= 1 && xx >= 1 && sz >= 1))){
                cout << s << endl;
            }
            pos = i+1;
        }
    }
    return 0;
}

哪里错了??大佬们康康


by 迟暮天复明 @ 2024-06-28 00:46:27

你觉得你这样判出来的数字是对的吗


by Boing777_300er @ 2024-06-28 10:42:02

???????


|