社区讨论
数据过水
B3843[GESP202306 三级] 密码合规参与者 3已保存回复 4
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 4 条
- 当前快照
- 1 份
- 快照标识符
- @lo1m1w4c
- 此快照首次捕获于
- 2023/10/22 23:15 2 年前
- 此快照最后确认于
- 2023/11/03 00:00 2 年前
CPP
#include<iostream>
#include<string>
using namespace std;
string s;
int n,pos,a,b,c,d,err;
int main() {
cin>>s;
n=s.size();
for (int i=0;i<=n;i++) {
if (i!=n && s[i]!=',') continue;
int len=i-pos; pos=i+1;
if (len<6 || len>12) continue;
a=b=c=d=err=0;
for (int j=i-len;j<i;j++) {
char c=s[j];
if (c>='A' && c<='Z') a=1;
else if (c>='a' && c<='z') b=1;
else if (c>='0' && c<='9') c=1; // here
else if (c=='!' || c=='@' || c=='#' || c=='$')
d=1;
else { err=1; break; }
}
if (err) continue;
a+=b; a+=c;
if (a>=2 && d) {
for (int j=i-len;j<i;j++)
cout<<s[j];
cout<<endl;
}
}
return 0;
}
此处变量重名,但是代码过了
hack: czq@123456
回复
共 4 条回复,欢迎继续交流。
正在加载回复...