TJ
2025-09-18 22:55:35
发布于:上海
3阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
string s,h="";
cin>>s;
s+=',';
for(int i=0;i<s.size();i++){
if(s[i]!=','){
h+=s[i];
}else{
if(h.size()<6||h.size()>12){
h="";
continue;
}
bool f=true;
int a=0,b=0,c=0,d=0;
for(int j=0;j<h.size();j++){
if(h[j]>='a'&&h[j]<='z') a++;
else if(h[j]>='A'&&h[j]<='Z') b++;
else if(h[j]>='0'&&h[j]<='9') c++;
else if(h[j]=='!'||h[j]=='@'||h[j]=='#'||h[j]=='$') d++;
else{
f=false;
break;
}
}
int t=(a>0)+(b>0)+(c>0);
if(f&&t>=2&&d!=0) cout<<h<<endl;
h="";
}
}
return 0;
}
这里空空如也
有帮助,赞一个