lin_A_chu_K_fan @ 2024-09-30 14:01:41
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
string s1="";
int da,xiao,shu,fu,oth;
da=xiao=shu=fu=oth=0;
for(int i=0;i<s.length();i++){
if(s[i]!=','){
s1+=s[i];
if(s[i]>='a'&&s[i]<='z')xiao=1;
else if(s[i]>='A'&&s[i]<='Z')da=1;
else if(s[i]>='0'&&s[i]<='9')shu=1;
else if(s[i]=='@'||s[i]=='!'||s[i]=='#'||s[i]=='$')fu++;
else oth++;
continue;
}
if(xiao+da+shu>=2&&fu>0)
if(s1.length()>=6&&s1.length()<=12)
if(oth==0){
cout<<s1<<endl;
s1="";
}
}
}
没过,求助
by lin20081016 @ 2024-09-30 14:40:08
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
string s1="";
int da,xiao,shu,fu,oth;
da=xiao=shu=fu=oth=0;
for(int i=0;i<s.length();i++){
if(s[i]!=','){
s1+=s[i];
if(s[i]>='a'&&s[i]<='z')xiao=1;
else if(s[i]>='A'&&s[i]<='Z')da=1;
else if(s[i]>='0'&&s[i]<='9')shu=1;
else if(s[i]=='@'||s[i]=='!'||s[i]=='#'||s[i]=='$')fu++;
else oth++;
continue;
}
if(xiao+da+shu>=2&&fu>0)
if(s1.length()>=6&&s1.length()<=12)
if(oth==0){
cout<<s1<<endl;
}
s1="";
da=xiao=shu=fu=oth=0;
}
if(xiao+da+shu>=2&&fu>0)
if(s1.length()>=6&&s1.length()<=12)
if(oth==0){
cout<<s1<<endl;
}
}