《笔记16》
2025-08-27 10:42:18
发布于:广东
#include<bits/stdc++.h>
using namespace std;
char l[1010];
char p[1010];
bool check(char *str,int l){
if(l<6||l>12) return false;
bool a=false,b=false,c=false,d=false;
for(int i=0;str[i]!='\0';i++){
if('A'<=str[i]&&str[i]<='Z') a=true;
else if('a'<=str[i]&&str[i]<='z') b=true;
else if('0'<=str[i]&&str[i]<='9') c=true;
else if(str[i]=='!'||str[i]=='@'||str[i]=='#'||str[i]=='$') d=true;
else return false;
}
if(!d) return false;
if(a+b+c<2) return false;
return true;
}
int main(){
cin>>l;
int le=0;
for(int i=0;l!='\0';i++){
if(l[i]!=','){
p[le]=l[i];
le++;
}
else{
p[le]='\0';
if(check(p,le)){
cout<<p<<endl;
}
le=0;
}
}
if(le>0){
p[le]='\0';
if(check(p,le)){
cout<<p<<endl;
}
}
}
这里空空如也
有帮助,赞一个