45haotong @ 2024-06-06 20:15:06
#include<bits/stdc++.h>
using namespace std;
bool pd(string x)
{
if (x.length()-1<6||x.length()-1>12)
return 0;
int sz=0,zf=0,zm1=0,zm2=0;//数字,字母1,字母2,特殊字符
for (int i=1;i<x.length();i++)
{
if (x[i]>='0'&&x[i]<='9')
sz++;
else if (x[i]>='a'&&x[i]<='z')
zm1++;
else if (x[i]>='A'&&x[i]<='Z')
zm2++;
else if (x[i]=='!'||x[i]=='@'||x[i]=='#'||x[i]=='$')
zf++;
else
return 0;
}
if (sz+zm2+zm1>=2&&zf>=1)
return 1;
return 0;
}
int main()
{
string a,x=" ";
getline(cin,a);
for (int i=0;i<a.length();i++)
{
if (a[i]!=',')
x+=a[i];
else
{
if (pd(x))
{
for (int i=1;i<x.length();i++)
cout<<x[i];
}
cout<<endl;
x=" ";
}
}
if (pd(x))
cout<<x<<endl;
}
by jialeNo1 @ 2024-06-16 18:14:14
@45haotong
by 45haotong @ 2024-06-16 20:00:24
@jialeNo1 谢谢,(^_^)