pengliujizhan @ 2024-12-14 08:51:32
0分,wa
#include<bits/stdc++.h>
using namespace std;
string a;
long long int j=0;
int main(){
cin>>a;
a=a+',';
for(int i=0;i<a.size();i++)
{
if(a[i]==',')
{
bool g=0;
long long int h=0,f=0,r=0,s=0;
for(int l=j;l<i;l++)
{
if(a[l]>='a'&&a[l]<='z')h=1;
else if(a[l]>='A'&&a[l]<='Z')f=1;
else if(a[l]>='0'&&a[l]<='9')r=1;
else if(a[l]=='!'||a[l]=='@'||a[l]=='#'||a[l]=='$')s=1;
else
{
g=1;
break;
}
}
if(g==0&&i-j+1>=6&&i-j+1<=12&&h+f+r>=2&&s>=1)
{
for(int l=j;l<i;l++)
{
cout<<a[l];
}
cout<<"\n";
}
j=i+1;
}
}
return 0;
}
by nnn233 @ 2024-12-14 09:08:42
@pengliujizhan
i-j+1
错了,,
,不用算在密码长度中
by nnn233 @ 2024-12-14 09:11:31
@pengliujizhan
实际的密码长度应该是i-j
by pengliujizhan @ 2024-12-14 09:59:15
@nnn233 谢谢
by pengliujizhan @ 2024-12-14 10:48:27
@nnn233 谢谢