跳到正文

个人记录

ifdsifdshiodhihfd

yimeiyingbi约 1 分钟
原文
文章信息与版本

文章信息

收录
2026年7月13日
更新
2026年7月13日
篇幅
约 1 分钟

版本

  1. v1当前
C++
#include<bits/stdc++.h>
using namespace std;
bool check(string a){
    if(a.size()<6||a.size()>12){return 0;}
    int upp=0,low=0,num=0,spe=0;
    for(int i=0;i<a.size();i++){
        if(a[i]>='a'&&a[i]<='z')low=1;
        else if(a[i]>='A'&&a[i]<='Z')upp=1;
        else if(a[i]>='0'&&a[i]<='9')num=1;
        else if(a[i]=='!'||a[i]=='@'||a[i]=='#'||a[i]=='$')spe=1;
        else return 0;
    }
    if((upp+low+num)>=2&&spe)return 1;
    else return 0;
}
int main(){
    string s;
    string a="";
    cin>>s;
    for(int i=0;i<=s.size();i++){
        if(s[i]==','||i==s.size()){
            if(check(a)){
                cout<<a+'\n';
            }
            a="";
        }
        else a+=s[i];
    }
    return 0;
}
原文