hjs133 @ 2024-05-21 14:34:57
#include<bits/stdc++.h>
using namespace std;
char a[110],e[110];
int o[20],u[10];
int b,c,d,f;
int main()
{
cin>>a;
b=strlen(a)+1;
for(int i=0;i<=b;i++){
memset(o,0,sizeof(o));
memset(u,0,sizeof(u));
e[c]=a[i];
c++;
if(a[i]==','||a[i]=='\0'){
e[c-1]='\0';
c=0;
for(int j=0;j<=strlen(e);j++){
if (e[j]>='1'&&e[j]<='9'){
o[0]+=1;
u[0]=1;
}
if(e[j]>='a'&&e[j]<='z'){
o[1]+=1;
u[1]=1;
}
if(e[j]>='A'&&e[j]<='Z'){
o[2]+=1;
u[2]=1;
}
if(e[j]=='!'||e[j]=='@'||e[j]=='#'||e[j]=='$'){
o[3]+=1;
u[3]=1;
}
}
if(o[0]+o[1]+o[2]+o[3]==strlen(e)&&u[0]+u[1]+u[2]>=2&&u[3]==1&&strlen(e)>=6&&strlen(e)<=12)
//if(o[0]+o[1]+o[2]+o[3]==strlen(e))
//if (u[0]+u[1]+u[2]>=2&&u[3]==1)
//if (strlen(e)>=6&&strlen(e)<=12)
cout<<e<<endl;
}
}
return 0;
}
by 编码落寞 @ 2024-05-21 15:32:42
if (e[j]>='1'&&e[j]<='9')
by hjs133 @ 2024-05-21 16:23:16
@编码落寞您好,没明白是什么意思?
by hjs133 @ 2024-05-21 16:32:21
@编码落寞 明白了,谢谢。