lsrlsrlsr @ 2024-12-29 09:06:08
#include<bits/stdc++.h>
using namespace std;
string n,x;
bool dxzm,xxzm,sz,tszf,ypfj;//大写字母,小写字母,数字,特殊字符,一票否决(其他字符)
int main(){
getline(cin,n);
for(int i=0;i<n.size();i++){
if(n[i]==','){//判断是否合规
if(x.size()>6&&x.size()<12){
if(tszf){
if(dxzm){
if(xxzm){
if(sz){
if(!ypfj){
cout<<x<<endl;
}
}
}
}
}
}
x="";
tszf=dxzm=xxzm=sz=0;
continue;
}
x=x+n[i];
if(n[i]<='z'&&n[i]>='a'){
xxzm=1;
continue;
}
if(n[i]<='Z'&&n[i]>='A'){
dxzm=1;
continue;
}
if(n[i]<='9'&&n[i]>='1'){
sz=1;
continue;
}
if(n[i]=='#'||n[i]=='!'||n[i]=='@'||n[i]=='$'){
tszf=1;
continue;
}
ypfj=1;
}
return 0;
}
by lsrlsrlsr @ 2024-12-29 09:09:49
回复请@一下我
by JmBecca @ 2024-12-29 09:21:12
@lsrlsrlsr请审清题,题目是说大小写字母和数字至少有两个以上就行了,而你这样写等于是三种都要有,所以测试会返回too short,也就是你排除了一些本来合规的情况
祝早日AC,求关哈,嘻嘻
by lsrlsrlsr @ 2024-12-29 13:31:06
@JmBecca感谢大佬,早上没睡醒
已关